Skip to content

Commit

Permalink
replace commands and start to use the package
Browse files Browse the repository at this point in the history
  • Loading branch information
htrgouvea committed Jun 7, 2024
1 parent ca9063f commit 6f1ed90
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions lib/Nipe/Utils/Install.pm
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ 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",
Expand All @@ -16,17 +15,15 @@ package Nipe::Utils::Install {
"opensuse" => "zypper install -y tor iptables"
);

if ($device{distribution} eq "void") {
$stopTor = "sv stop tor > /dev/null";
}
system("$install{$device{distribution}}");

if (-e "/etc/init.d/tor") {
$stopTor = "/etc/init.d/tor stop > /dev/null";
}
my $stop = Nipe::Engine::Stop -> new();

system("$install{$device{distribution}} && $stopTor");
if ($stop) {
return 1;
}

return 1;
return 0;
}
}

Expand Down

0 comments on commit 6f1ed90

Please sign in to comment.