From 33bca64c50ce3923c3dc09d2cf0be8527bee2729 Mon Sep 17 00:00:00 2001 From: GouveaHeitor Date: Sat, 27 Jun 2020 12:27:08 -0300 Subject: [PATCH] moving the root check to another part that makes more sense --- lib/Nipe/Engine/Start.pm | 2 +- nipe.pl | 5 ++--- 2 files changed, 3 insertions(+), 4 deletions(-) diff --git a/lib/Nipe/Engine/Start.pm b/lib/Nipe/Engine/Start.pm index 281e2cc..fdb401c 100644 --- a/lib/Nipe/Engine/Start.pm +++ b/lib/Nipe/Engine/Start.pm @@ -5,7 +5,7 @@ use warnings; use Nipe::Utils::Device; sub new { - my %device = Nipe::Utils::Device -> new(); + my %device = Nipe::Utils::Device -> new(); my $dnsPort = "9061"; my $transferPort = "9051"; my @table = ("nat", "filter"); diff --git a/nipe.pl b/nipe.pl index 38f8754..8fdbd3c 100755 --- a/nipe.pl +++ b/nipe.pl @@ -12,13 +12,12 @@ use Nipe::Utils::Status; use Nipe::Utils::Helper; use Nipe::Utils::Install; - sub main { - die "Nipe must be run as root.\n" if $> != 0; - my $argument = $ARGV[0]; if ($argument) { + die "Nipe must be run as root.\n" if $> != 0; + my $commands = { stop => "Nipe::Engine::Stop", start => "Nipe::Engine::Start",