From: Stefan Schantl Date: Thu, 2 Oct 2014 19:42:27 +0000 (+0200) Subject: guardian: Use Getop::Std. X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d15ca36d0bbc3295a5fb03ef9110ad8804c23045;p=people%2Fstevee%2Fipfire-2.x.git guardian: Use Getop::Std. --- diff --git a/config/guardian/guardian.pl b/config/guardian/guardian.pl index 75982ef9a1..9775cd4356 100644 --- a/config/guardian/guardian.pl +++ b/config/guardian/guardian.pl @@ -7,14 +7,15 @@ # Added SSH-Watch for SSH-Bruteforce Attacks # An suppected IP will be blocked on all interfaces -require 'getopts.pl'; +use Getopt::Std; $guardianctrl = "/usr/local/bin/guardianctrl"; # Array to store information about ignored networks. my @ignored_networks = (); -&Getopts ('hc:d'); +# Option parser for given arguments from command line. +getopts ('hc:d'); if (defined($opt_h)) { print "Guardian v1.7 \n"; print "guardian.pl [-hd] <-c config>\n"; @@ -23,7 +24,11 @@ if (defined($opt_h)) { print " -c specifiy a configuration file other than the default (/etc/guardian/guardian.conf)\n"; exit; } + +# Call function to read in the configuration file. &load_conf; + +# Setup signal handler. &sig_handler_setup; &write_log ("My ip address and interface are: $hostipaddr $interface\n");