diff options
author | ivan <ivan> | 2001-05-08 10:44:17 +0000 |
---|---|---|
committer | ivan <ivan> | 2001-05-08 10:44:17 +0000 |
commit | 365fdd1f1938f399113a5ce013a7c2daa431a5c2 (patch) | |
tree | 5cdfd1d05f703b459623262703dd7ee2e1f53938 | |
parent | 38e969ecf93f56c05e06bbcd24e9bd1ddf56d709 (diff) |
fix for OO Net::SCP
-rwxr-xr-x | bin/svc_acct.export | 56 | ||||
-rwxr-xr-x | bin/svc_acct_sm.export | 29 |
2 files changed, 51 insertions, 34 deletions
diff --git a/bin/svc_acct.export b/bin/svc_acct.export index 073359587..1c3ffa243 100755 --- a/bin/svc_acct.export +++ b/bin/svc_acct.export @@ -1,6 +1,6 @@ #!/usr/bin/perl -w # -# $Id: svc_acct.export,v 1.18 2001-04-22 01:56:15 ivan Exp $ +# $Id: svc_acct.export,v 1.19 2001-05-08 10:44:17 ivan Exp $ # # Create and export password files: passwd, passwd.adjunct, shadow, # acp_passwd, acp_userinfo, acp_dialup, users @@ -38,7 +38,10 @@ # ivan@sisd.com 98-sep-18 # # $Log: svc_acct.export,v $ -# Revision 1.18 2001-04-22 01:56:15 ivan +# Revision 1.19 2001-05-08 10:44:17 ivan +# fix for OO Net::SCP +# +# Revision 1.18 2001/04/22 01:56:15 ivan # get rid of FS::SSH.pm (became Net::SSH and Net::SCP on CPAN) # # Revision 1.17 2001/02/21 23:48:19 ivan @@ -349,10 +352,11 @@ close USERS; my($shellmachine); foreach $shellmachine (@shellmachines) { - scp("$spooldir/passwd","root\@$shellmachine:/etc/passwd.new") - == 0 or die "scp error: $!"; - scp("$spooldir/shadow","root\@$shellmachine:/etc/shadow.new") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/passwd","root\@$shellmachine:/etc/passwd.new") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/shadow","root\@$shellmachine:/etc/shadow.new") + or die "scp error: ". $scp->{errstr}; ssh("root\@$shellmachine", "( ". "mv /etc/passwd.new /etc/passwd; ". @@ -364,10 +368,11 @@ foreach $shellmachine (@shellmachines) { my($bsdshellmachine); foreach $bsdshellmachine (@bsdshellmachines) { - scp("$spooldir/passwd","root\@$bsdshellmachine:/etc/passwd.new") - == 0 or die "scp error: $!"; - scp("$spooldir/master.passwd","root\@$bsdshellmachine:/etc/master.passwd.new") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/passwd","root\@$bsdshellmachine:/etc/passwd.new") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/master.passwd","root\@$bsdshellmachine:/etc/master.passwd.new") + or die "scp error: ". $scp->{errstr}; ssh("root\@$bsdshellmachine", "( ". "mv /etc/passwd.new /etc/passwd; ". @@ -379,10 +384,11 @@ foreach $bsdshellmachine (@bsdshellmachines) { my($nismachine); foreach $nismachine (@nismachines) { - scp("$spooldir/passwd","root\@$nismachine:/etc/global/passwd") - == 0 or die "scp error: $!"; - scp("$spooldir/shadow","root\@$nismachine:/etc/global/shadow") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/passwd","root\@$nismachine:/etc/global/passwd") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/shadow","root\@$nismachine:/etc/global/shadow") + or die "scp error: ". $scp->{errstr}; ssh("root\@$nismachine", "( ". "cd /var/yp; make; ". @@ -393,10 +399,11 @@ foreach $nismachine (@nismachines) { my($erpcdmachine); foreach $erpcdmachine (@erpcdmachines) { - scp("$spooldir/acp_passwd","root\@$erpcdmachine:/usr/annex/acp_passwd") - == 0 or die "scp error: $!"; - scp("$spooldir/acp_dialup","root\@$erpcdmachine:/usr/annex/acp_dialup") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/acp_passwd","root\@$erpcdmachine:/usr/annex/acp_passwd") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/acp_dialup","root\@$erpcdmachine:/usr/annex/acp_dialup") + or die "scp error: ". $scp->{errstr}; ssh("root\@$erpcdmachine", "( ". "kill -USR1 \`cat /usr/annex/erpcd.pid\'". @@ -407,8 +414,9 @@ foreach $erpcdmachine (@erpcdmachines) { my($radiusmachine); foreach $radiusmachine (@radiusmachines) { - scp("$spooldir/users","root\@$radiusmachine:/etc/raddb/users") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/users","root\@$radiusmachine:/etc/raddb/users") + or die "scp error: ". $scp->{errstr}; ssh("root\@$radiusmachine", "( ". "builddbm". @@ -426,10 +434,14 @@ foreach my $icradiusmachine ( @icradiusmachines ) { sleep 2; print WRITER "LOCK TABLES radcheck WRITE, radreply WRITE;\n"; foreach my $file ( glob("radcheck.*") ) { - scp($file,"root\@$machine:$icradius_mysqldest/$db/$file"); + my $scp = new Net::SCP; + $scp->scp($file,"root\@$machine:$icradius_mysqldest/$db/$file") + or die "scp error: ". $scp->{errstr}; } foreach my $file ( glob("radreply.*") ) { - scp($file,"root\@$machine:$icradius_mysqldest/$db/$file"); + my $scp = new Net::SCP; + $scp->scp($file,"root\@$machine:$icradius_mysqldest/$db/$file") + or die "scp error: ". $scp->{errstr}; } close WRITER; } diff --git a/bin/svc_acct_sm.export b/bin/svc_acct_sm.export index a0938caf2..d7a7840f1 100755 --- a/bin/svc_acct_sm.export +++ b/bin/svc_acct_sm.export @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_acct_sm.export,v 1.9 2001-04-22 01:56:15 ivan Exp $ +# $Id: svc_acct_sm.export,v 1.10 2001-05-08 10:44:17 ivan Exp $ # # Create and export config files for sendmail, qmail # @@ -42,7 +42,10 @@ # /var/spool/freeside/conf and sendmail updates ivan@sisd.com 98-aug-14 # # $Log: svc_acct_sm.export,v $ -# Revision 1.9 2001-04-22 01:56:15 ivan +# Revision 1.10 2001-05-08 10:44:17 ivan +# fix for OO Net::SCP +# +# Revision 1.9 2001/04/22 01:56:15 ivan # get rid of FS::SSH.pm (became Net::SSH and Net::SCP on CPAN) # # Revision 1.8 2000/07/06 03:37:24 ivan @@ -211,10 +214,11 @@ close VIRTUALDOMAINS; my($sendmailmachine); foreach $sendmailmachine (@sendmailmachines) { - scp("$spooldir/sendmail.cw","root\@$sendmailmachine:$sendmailconfigpath/sendmail.cw.new") - == 0 or die "scp error: $!"; - scp("$spooldir/virtusertable","root\@$sendmailmachine:$sendmailconfigpath/virtusertable.new") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/sendmail.cw","root\@$sendmailmachine:$sendmailconfigpath/sendmail.cw.new") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/virtusertable","root\@$sendmailmachine:$sendmailconfigpath/virtusertable.new") + or die "scp error: ". $scp->{errstr}; ssh("root\@$sendmailmachine", "( ". "mv $sendmailconfigpath/sendmail.cw.new $sendmailconfigpath/sendmail.cw; ". @@ -227,12 +231,13 @@ foreach $sendmailmachine (@sendmailmachines) { my($qmailmachine); foreach $qmailmachine (@qmailmachines) { - scp("$spooldir/recipientmap","root\@$qmailmachine:/var/qmail/control/recipientmap") - == 0 or die "scp error: $!"; - scp("$spooldir/virtualdomains","root\@$qmailmachine:/var/qmail/control/virtualdomains") - == 0 or die "scp error: $!"; - scp("$spooldir/rcpthosts","root\@$qmailmachine:/var/qmail/control/rcpthosts") - == 0 or die "scp error: $!"; + my $scp = new Net::SCP; + $scp->scp("$spooldir/recipientmap","root\@$qmailmachine:/var/qmail/control/recipientmap") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/virtualdomains","root\@$qmailmachine:/var/qmail/control/virtualdomains") + or die "scp error: ". $scp->{errstr}; + $scp->scp("$spooldir/rcpthosts","root\@$qmailmachine:/var/qmail/control/rcpthosts") + or die "scp error: ". $scp->{errstr}; #ssh("root\@$qmailmachine","/etc/init.d/qmail restart") # == 0 or die "ssh error: $!"; } |