[Netpass-devel] NetPass/bin garp.pl,1.4,1.5 garpctl,1.6,1.7 interfacecfg.pl,1.10,1.11
Brought to you by:
jeffmurphy
From: jeff m. <jef...@us...> - 2005-05-17 01:34:03
|
Update of /cvsroot/netpass/NetPass/bin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28720/bin Modified Files: garp.pl garpctl interfacecfg.pl Log Message: startup bugs, garp issues Index: interfacecfg.pl =================================================================== RCS file: /cvsroot/netpass/NetPass/bin/interfacecfg.pl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -d -r1.10 -r1.11 --- interfacecfg.pl 12 Apr 2005 15:24:08 -0000 1.10 +++ interfacecfg.pl 16 May 2005 16:10:42 -0000 1.11 @@ -55,8 +55,8 @@ use Getopt::Std; use lib qw(/opt/netpass/lib); use NetPass; +use Pod::Usage; -sub Usage(); sub getIps($); sub director($); sub realserver($); @@ -77,14 +77,14 @@ getopts('U:d:r:c:h', \%opts); -Usage() if ($opts{'h'}); +pod2usage(2) if ($opts{'h'}); if (exists $opts{'r'} && ($opts{'r'} > 2 || $opts{'r'} < 1)) { - Usage(); + pod2usage(1); } if (exists $opts{'d'} && ($opts{'d'} > 2 || $opts{'d'} < 1)) { - Usage(); + pod2usage(1); } $rord = ($opts{'r'}) ? 'r' : 'd'; @@ -228,11 +228,6 @@ END } -sub Usage () { - print "Usage: $0 <[-d director] | [-r realserver]> <-c conf file>\n"; - exit 0; -} - sub ip2int ($) { my $i = shift; Index: garp.pl =================================================================== RCS file: /cvsroot/netpass/NetPass/bin/garp.pl,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- garp.pl 24 Apr 2005 03:42:02 -0000 1.4 +++ garp.pl 16 May 2005 16:10:42 -0000 1.5 @@ -311,6 +311,7 @@ #define SIOCGIFHWADDR 0x8927 #define SIOCGIFADDR 0x8915 my $rv = ioctl SH, 0x8927, $ifr; + print "get_hwaddr: ioctl ret=".(defined($rv)?$rv:"undef")."\n" if $D; return (undef, undef) if ( !defined($rv) || ($rv ne "0 but true") ); my ($junk, $family); my @ma; Index: garpctl =================================================================== RCS file: /cvsroot/netpass/NetPass/bin/garpctl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -d -r1.6 -r1.7 --- garpctl 24 Apr 2005 03:42:02 -0000 1.6 +++ garpctl 16 May 2005 16:10:42 -0000 1.7 @@ -124,7 +124,7 @@ -debug => exists $opts{'D'} ? 1 : 0, -quiet => exists $opts{'q'} ? 1 : 0); -die "failed to connect to NetPass: $np" unless (ref($np) ne "NetPass"); +die "failed to connect to NetPass: $np" if (ref($np) ne "NetPass"); my $pidDir = $np->cfg->policy(-key => 'pid_dir') || "/var/run/netpass"; my $pids = getPids($pidDir); @@ -235,12 +235,22 @@ $gd = ""; } - my $shell_comm = qq{$baseDir/bin/garp.pl -i ${if}.${u} $gn $gd $vip}; + my $cstr = ''; + + if (exists $opts{'c'}) { + $cstr = "-c '".$opts{'c'}."'"; + } + + if (exists $opts{'U'}) { + $cstr .= " -U '".$opts{'U'}."'"; + } + + my $shell_comm = qq{$baseDir/bin/garp.pl $cstr -i ${if}.${u} $gn $gd $vip}; print "\t\tshell_comm = $shell_comm\n" if exists $opts{'D'}; $rv = system $shell_comm || $rv; - $shell_comm = qq{$baseDir/bin/garp.pl -i ${if}.${q} $gn $gd $vip}; + $shell_comm = qq{$baseDir/bin/garp.pl $cstr -i ${if}.${q} $gn $gd $vip}; print "\t\tshell_comm = $shell_comm\n" if exists $opts{'D'}; $rv = system $shell_comm || $rv; |