Skip to content

Commit

Permalink
fix linter warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Nov 12, 2023
1 parent 6315a40 commit dc125e8
Show file tree
Hide file tree
Showing 4 changed files with 17 additions and 15 deletions.
18 changes: 9 additions & 9 deletions lib/Nipe/Utils/Helper.pm
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@ package Nipe::Utils::Helper {

sub new {
return "
\rCore Commands
\r==============
\r\tCommand Description
\r\t------- -----------
\r\tinstall Install dependencies
\r\tstart Start routing
\r\tstop Stop routing
\r\trestart Restart the Nipe circuit
\r\tstatus See status\n\n";
\rCore Commands
\r==============
\r\tCommand Description
\r\t------- -----------
\r\tinstall Install dependencies
\r\tstart Start routing
\r\tstop Stop routing
\r\trestart Restart the Nipe circuit
\r\tstatus See status\n\n";
}
}

Expand Down
2 changes: 1 addition & 1 deletion lib/Nipe/Utils/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ package Nipe::Utils::Install {
sub new {
my %device = Nipe::Utils::Device -> new();
my $stopTor = "systemctl stop tor";

my %install = (
"debian" => "apt-get install -y tor iptables",
"fedora" => "dnf install -y tor iptables",
Expand Down
10 changes: 6 additions & 4 deletions lib/Nipe/Utils/Status.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@ package Nipe::Utils::Status {
use HTTP::Tiny;

sub new {
my $apiCheck = "https://check.torproject.org/api/ip";
my $request = HTTP::Tiny -> new -> get($apiCheck);

if ($request -> {status} == 200) {
use constant SUCCESS_CODE => 200;

my $apiCheck = "https://check.torproject.org/api/ip";
my $request = HTTP::Tiny -> new -> get($apiCheck);

if ($request -> {status} == SUCCESS_CODE) {
my $data = decode_json ($request -> {content});

my $checkIp = $data -> {"IP"};
Expand Down
2 changes: 1 addition & 1 deletion nipe.pl
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

sub main {
my $argument = $ARGV[0];

if ($argument) {
die "Nipe must be run as root.\n" if $< != 0;

Expand Down

0 comments on commit dc125e8

Please sign in to comment.