]> git.ipfire.org Git - people/stevee/ipfire-2.x.git/commitdiff
guardian: Use Getop::Std.
authorStefan Schantl <stefan.schantl@ipfire.org>
Thu, 2 Oct 2014 19:42:27 +0000 (21:42 +0200)
committerStefan Schantl <stefan.schantl@ipfire.org>
Thu, 2 Oct 2014 19:42:27 +0000 (21:42 +0200)
config/guardian/guardian.pl

index 75982ef9a1fdf2229db450ce094bb2971c544762..9775cd43564cba889273e76b8983f03733807c54 100644 (file)
@@ -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");