From 4463319cd048cedf0a46bb4b41668192603f10c1 Mon Sep 17 00:00:00 2001 From: Heikki Hannikainen Date: Thu, 11 Apr 2013 23:52:24 +0300 Subject: [PATCH] version 1.3, update changelog and command line help --- rip44d | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/rip44d b/rip44d index 24dabe6..1541455 100755 --- a/rip44d +++ b/rip44d @@ -26,6 +26,10 @@ # * Added syslog functionality, using module: http://perldoc.perl.org/Sys/Syslog.html # * Fixed to use CIDR format when calling /sbin/ip, to support older distributions # +# v1.3 - 2013-04-11 Heikki Hannikainen, OH7LZB +# * write pid file and lock it to prevent running multiple copies +# * fix a bug in interim version after 1.2: added routes with wrong prefix length +# # Things to do in the future: # @@ -76,7 +80,7 @@ my $route_ttl = 7*24*60*60; my %current_routes; my $me = 'rip44d'; -my $VERSION = '1.2'; +my $VERSION = '1.3'; # help and version texts $Getopt::Std::STANDARD_HELP_VERSION = 1; @@ -94,13 +98,13 @@ sub do_syslog($) } } -sub HELP_MESSAGE() +sub HELP_MESSAGE($) { my($fh) = @_; print $fh "Usage:\n" . " $me [-v] [-d] [-s] [-i ] [-a ] [-p ]\n" - . " [-t ]\n" + . " [-t ] [-l ]\n" . "Options:\n" . " -v increase verbosity slightly to print error messages on stderr\n" . " -d increase verbosity greatly (debug mode)\n" @@ -115,6 +119,9 @@ sub HELP_MESSAGE() . " -t \n" . " insert routes in an alternate named routing table\n" . " (ip route add .. table )\n" + . " -l \n" + . " write process ID to given file instead of default\n" + . " (/var/run/rip44d.pid)\n" ; } @@ -439,7 +446,7 @@ sub process_msg($$$) # command line parsing my %opts; -getopts('i:p:l:a:t:vds', \%opts); +getopts('i:p:l:a:t:vhds', \%opts); if (defined $opts{'i'}) { $tunnel_if = $opts{'i'}; @@ -467,6 +474,10 @@ if ($opts{'a'}) { $my_addresses{$a} = 1; } } +if ($opts{'h'}) { + HELP_MESSAGE(*STDOUT); + exit(0); +} openlog($me, 'cons,pid', 'user') if ($log_syslog); writepid($pidfile);