From 1c14b1faec0f3f07a6d4190cf535b3ddb45075ce Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 22 Apr 2001 01:56:15 +0000 Subject: [PATCH] get rid of FS::SSH.pm (became Net::SSH and Net::SCP on CPAN) --- FS/FS.pm | 25 ++------ FS/FS/SSH.pm | 146 --------------------------------------------- FS/FS/svc_acct.pm | 6 +- FS/FS/svc_acct_sm.pm | 6 +- FS/FS/svc_domain.pm | 4 +- FS/FS/svc_www.pm | 9 ++- FS/MANIFEST | 1 - README | 4 +- bin/svc_acct.export | 10 +++- bin/svc_acct.import | 9 ++- bin/svc_acct_sm.export | 10 +++- bin/svc_acct_sm.import | 9 ++- bin/svc_domain.import | 4 +- fs_passwd/fs_passwd_server | 2 +- fs_signup/fs_signup_server | 2 +- htdocs/docs/install.html | 3 + 16 files changed, 54 insertions(+), 196 deletions(-) delete mode 100644 FS/FS/SSH.pm diff --git a/FS/FS.pm b/FS/FS.pm index 64461a5d1..3fd66b1fe 100644 --- a/FS/FS.pm +++ b/FS/FS.pm @@ -14,27 +14,11 @@ FS - Freeside Perl modules =head1 SYNOPSIS -FS is the temporary prefix for many disparate modules written for the Freeside -ISP billing software. This includes: - -=head2 Database metadata classes - -L - Database class - -L - Database table class - -L - Database column class - -L - Database column group class - -L - Database index class - -L - Database unique index class +FS is the unofficial (i.e. non-CPAN) prefix for the Perl module portion of the +Freeside ISP billing software. This includes: =head2 Utility classes -L - Simple wrappers around ssh and scp commands. - L - Freeside configuration values L - User class (not yet OO) @@ -127,7 +111,7 @@ The main documentation is in htdocs/docs. =head1 VERSION -$Id: FS.pm,v 1.3 1999-08-04 12:41:47 ivan Exp $ +$Id: FS.pm,v 1.4 2001-04-22 01:56:14 ivan Exp $ =head1 SUPPORT @@ -155,7 +139,8 @@ Freeside distribution, which are both different from the CVS version tag for each file, which appears under the VERSION heading. Those modules which would be useful separately should be pulled out, -renamed appropriately and uploaded to CPAN. +renamed appropriately and uploaded to CPAN. So far: DBIx::DBSchema, Net::SSH +and Net::SCP... =cut diff --git a/FS/FS/SSH.pm b/FS/FS/SSH.pm deleted file mode 100644 index 84ac06b44..000000000 --- a/FS/FS/SSH.pm +++ /dev/null @@ -1,146 +0,0 @@ -package FS::SSH; - -use strict; -use vars qw(@ISA @EXPORT_OK $ssh $scp); -use Exporter; -use IPC::Open2; -use IPC::Open3; - -@ISA = qw(Exporter); -@EXPORT_OK = qw(ssh scp issh iscp sshopen2 sshopen3); - -$ssh="ssh"; -$scp="scp"; - -=head1 NAME - -FS::SSH - Subroutines to call ssh and scp - -=head1 SYNOPSIS - - use FS::SSH qw(ssh scp issh iscp sshopen2 sshopen3); - - ssh($host, $command); - - issh($host, $command); - - scp($source, $destination); - - iscp($source, $destination); - - sshopen2($host, $reader, $writer, $command); - - sshopen3($host, $reader, $writer, $error, $command); - -=head1 DESCRIPTION - - Simple wrappers around ssh and scp commands. - -=head1 SUBROUTINES - -=over 4 - -=item ssh HOST, COMMAND - -Calls ssh in batch mode. - -=cut - -sub ssh { - my($host,$command)=@_; - my(@cmd)=($ssh, "-o", "BatchMode yes", $host, $command); -# print join(' ',@cmd),"\n"; -#0; - system(@cmd); -} - -=item issh HOST, COMMAND - -Prints the ssh command to be executed, waits for the user to confirm, and -(optionally) executes the command. - -=cut - -sub issh { - my($host,$command)=@_; - my(@cmd)=($ssh, $host, $command); - print join(' ',@cmd),"\n"; - if ( &_yesno ) { - ###print join(' ',@cmd),"\n"; - system(@cmd); - } -} - -=item scp SOURCE, DESTINATION - -Calls scp in batch mode. - -=cut - -sub scp { - my($src,$dest)=@_; - my(@cmd)=($scp,"-Bprq",$src,$dest); -# print join(' ',@cmd),"\n"; -#0; - system(@cmd); -} - -=item iscp SOURCE, DESTINATION - -Prints the scp command to be executed, waits for the user to confirm, and -(optionally) executes the command. - -=cut - -sub iscp { - my($src,$dest)=@_; - my(@cmd)=($scp,"-pr",$src,$dest); - print join(' ',@cmd),"\n"; - if ( &_yesno ) { - ###print join(' ',@cmd),"\n"; - system(@cmd); - } -} - -=item sshopen2 HOST, READER, WRITER, COMMAND - -Connects the supplied filehandles to the ssh process (in batch mode). - -=cut - -sub sshopen2 { - my($host,$reader,$writer,$command)=@_; - open2($reader,$writer,$ssh,'-o','Batchmode yes',$host,$command); -} - -=item sshopen3 HOST, WRITER, READER, ERROR, COMMAND - -Connects the supplied filehandles to the ssh process (in batch mode). - -=cut - -sub sshopen3 { - my($host,$writer,$reader,$error,$command)=@_; - open3($writer,$reader,$error,$ssh,'-o','Batchmode yes',$host,$command); -} - -sub _yesno { - print "Proceed [y/N]:"; - my($x)=scalar(); - $x =~ /^y/i; -} - -=head1 BUGS - -Not OO. - -scp stuff should transparantly use rsync-over-ssh instead. - -=head1 SEE ALSO - -L, L, L, L - -=cut - -1; - diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm index 9d2db0eff..79104b883 100644 --- a/FS/FS/svc_acct.pm +++ b/FS/FS/svc_acct.pm @@ -9,7 +9,7 @@ use Carp; use FS::Conf; use FS::Record qw( qsearchs fields ); use FS::svc_Common; -use FS::SSH qw(ssh); +use Net::SSH qw(ssh); use FS::part_svc; use FS::svc_acct_pop; use FS::svc_acct_sm; @@ -536,7 +536,7 @@ sub radius_check { =head1 VERSION -$Id: svc_acct.pm,v 1.14 2001-01-31 07:21:00 ivan Exp $ +$Id: svc_acct.pm,v 1.15 2001-04-22 01:56:15 ivan Exp $ =head1 BUGS @@ -552,7 +552,7 @@ counterintuitive. =head1 SEE ALSO L, L, L, L, -L, L, L, L, L, +L, L, L, L, L, schema.html from the base documentation. =cut diff --git a/FS/FS/svc_acct_sm.pm b/FS/FS/svc_acct_sm.pm index 15cf86d9b..8cec60b69 100644 --- a/FS/FS/svc_acct_sm.pm +++ b/FS/FS/svc_acct_sm.pm @@ -5,7 +5,7 @@ use vars qw( @ISA $nossh_hack $conf $shellmachine @qmailmachines ); use FS::Record qw( fields qsearch qsearchs ); use FS::svc_Common; use FS::cust_svc; -use FS::SSH qw(ssh); +use Net::SSH qw(ssh); use FS::Conf; use FS::svc_acct; use FS::svc_domain; @@ -233,7 +233,7 @@ sub check { =head1 VERSION -$Id: svc_acct_sm.pm,v 1.2 2000-06-30 10:37:18 ivan Exp $ +$Id: svc_acct_sm.pm,v 1.3 2001-04-22 01:56:15 ivan Exp $ =head1 BUGS @@ -244,7 +244,7 @@ The $recref stuff in sub check should be cleaned up. =head1 SEE ALSO L, L, L, L, L, -L, L, L, L, L, +L, L, L, L, L, schema.html from the base documentation. =cut diff --git a/FS/FS/svc_domain.pm b/FS/FS/svc_domain.pm index 08bcc246e..a70c1a340 100644 --- a/FS/FS/svc_domain.pm +++ b/FS/FS/svc_domain.pm @@ -478,7 +478,7 @@ sub submit_internic { =head1 VERSION -$Id: svc_domain.pm,v 1.9 2001-04-22 01:38:39 ivan Exp $ +$Id: svc_domain.pm,v 1.10 2001-04-22 01:56:15 ivan Exp $ =head1 BUGS @@ -495,7 +495,7 @@ The $recref stuff in sub check should be cleaned up. =head1 SEE ALSO L, L, L, L, -L, L, L, L, L, +L, L, L, L, L, schema.html from the base documentation, config.html from the base documentation. diff --git a/FS/FS/svc_www.pm b/FS/FS/svc_www.pm index 6e741950f..bce69d6a9 100644 --- a/FS/FS/svc_www.pm +++ b/FS/FS/svc_www.pm @@ -8,7 +8,7 @@ use FS::svc_Common; use FS::cust_svc; use FS::domain_record; use FS::svc_acct; -use FS::SSH qw(ssh); +use Net::SSH qw(ssh); @ISA = qw( FS::svc_Common ); @@ -220,7 +220,7 @@ sub check { =head1 VERSION -$Id: svc_www.pm,v 1.3 2000-11-22 23:30:51 ivan Exp $ +$Id: svc_www.pm,v 1.4 2001-04-22 01:56:15 ivan Exp $ =head1 BUGS @@ -232,7 +232,10 @@ L, L, schema.html from the base documentation. =head1 HISTORY $Log: svc_www.pm,v $ -Revision 1.3 2000-11-22 23:30:51 ivan +Revision 1.4 2001-04-22 01:56:15 ivan +get rid of FS::SSH.pm (became Net::SSH and Net::SCP on CPAN) + +Revision 1.3 2000/11/22 23:30:51 ivan tyop Revision 1.2 2000/03/01 08:13:59 ivan diff --git a/FS/MANIFEST b/FS/MANIFEST index a373f9a07..98f76acda 100644 --- a/FS/MANIFEST +++ b/FS/MANIFEST @@ -3,7 +3,6 @@ FS.pm FS/CGI.pm FS/Conf.pm FS/Record.pm -FS/SSH.pm FS/UI/Base.pm FS/UI/CGI.pm FS/UI/Gtk.pm diff --git a/README b/README index 31601ef76..dab32d607 100644 --- a/README +++ b/README @@ -1,6 +1,6 @@ -Freeside, (pre-1.3.0) +Freeside, (1.3.0) -Copyright (C) 2000 Ivan Kohler +Copyright (C) 2000,2001 Ivan Kohler Copyright (C) 1999 Silicon Interactive Software Design All rights reserved diff --git a/bin/svc_acct.export b/bin/svc_acct.export index 3280904f6..073359587 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.17 2001-02-21 23:48:19 ivan Exp $ +# $Id: svc_acct.export,v 1.18 2001-04-22 01:56:15 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.17 2001-02-21 23:48:19 ivan +# 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 # add icradius_secrets config file to export to a non-Freeside MySQL database for # ICRADIUS # @@ -70,7 +73,8 @@ use Fcntl qw(:flock); use IO::Handle; use DBI; use FS::Conf; -use FS::SSH qw(scp ssh); +use Net::SSH qw(ssh); +use Net::SCP qw(scp); use FS::UID qw(adminsuidsetup datasrc dbh); use FS::Record qw(qsearch fields); use FS::svc_acct; diff --git a/bin/svc_acct.import b/bin/svc_acct.import index 795b853c0..0acd731c5 100755 --- a/bin/svc_acct.import +++ b/bin/svc_acct.import @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_acct.import,v 1.11 2000-06-29 12:27:01 ivan Exp $ +# $Id: svc_acct.import,v 1.12 2001-04-22 01:56:15 ivan Exp $ # # ivan@sisd.com 98-mar-9 # @@ -17,7 +17,10 @@ # don't import /var/spool/freeside/conf/shells! ivan@sisd.com 98-aug-13 # # $Log: svc_acct.import,v $ -# Revision 1.11 2000-06-29 12:27:01 ivan +# Revision 1.12 2001-04-22 01:56:15 ivan +# get rid of FS::SSH.pm (became Net::SSH and Net::SCP on CPAN) +# +# Revision 1.11 2000/06/29 12:27:01 ivan # s/password/_password/ for PostgreSQL wasn't done in the import. # # Revision 1.10 2000/06/28 12:32:30 ivan @@ -49,7 +52,7 @@ use strict; use vars qw(%part_svc); use Date::Parse; use Term::Query qw(query); -use FS::SSH qw(iscp); +use Net::SCP qw(iscp); use FS::UID qw(adminsuidsetup datasrc); use FS::Record qw(qsearch); use FS::svc_acct; diff --git a/bin/svc_acct_sm.export b/bin/svc_acct_sm.export index bda17e332..a0938caf2 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.8 2000-07-06 03:37:24 ivan Exp $ +# $Id: svc_acct_sm.export,v 1.9 2001-04-22 01:56:15 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.8 2000-07-06 03:37:24 ivan +# 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 # don't error out on invalid svc_acct_sm.domuid's that can't be matched in # svc_acct.uid - just warn. # @@ -68,7 +71,8 @@ use strict; use vars qw($conf); use Fcntl qw(:flock); -use FS::SSH qw(ssh scp); +use Net::SSH qw(ssh); +use Net::SCP qw(scp); use FS::UID qw(adminsuidsetup datasrc); use FS::Record qw(qsearch qsearchs); use FS::svc_acct; diff --git a/bin/svc_acct_sm.import b/bin/svc_acct_sm.import index 0714af3f1..723fb029f 100755 --- a/bin/svc_acct_sm.import +++ b/bin/svc_acct_sm.import @@ -1,6 +1,6 @@ #!/usr/bin/perl -Tw # -# $Id: svc_acct_sm.import,v 1.8 2000-12-03 15:14:00 ivan Exp $ +# $Id: svc_acct_sm.import,v 1.9 2001-04-22 01:56:15 ivan Exp $ # # ivan@sisd.com 98-mar-9 # @@ -16,7 +16,10 @@ # ivan@sisd.com 98-jul-13 # # $Log: svc_acct_sm.import,v $ -# Revision 1.8 2000-12-03 15:14:00 ivan +# 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/12/03 15:14:00 ivan # bugfixes from Jeff Finucane , thanks! # # Revision 1.7 2000/06/29 10:51:52 ivan @@ -41,7 +44,7 @@ use strict; use vars qw(%d_part_svc %m_part_svc); use Term::Query qw(query); -use FS::SSH qw(iscp); +use Net::SCP qw(iscp); use FS::UID qw(adminsuidsetup datasrc); use FS::Record qw(qsearch qsearchs); use FS::svc_acct_sm; diff --git a/bin/svc_domain.import b/bin/svc_domain.import index 329465ca1..3d3be9da5 100644 --- a/bin/svc_domain.import +++ b/bin/svc_domain.import @@ -1,11 +1,11 @@ #!/usr/bin/perl -w # -# $Id: svc_domain.import,v 1.1 2000-02-03 05:17:39 ivan Exp $ +# $Id: svc_domain.import,v 1.2 2001-04-22 01:56:15 ivan Exp $ use strict; use vars qw( %d_part_svc ); use Term::Query qw(query); -use FS::SSH qw(iscp); +use Net::SCP qw(iscp); use FS::UID qw(adminsuidsetup datasrc); #use FS::Record qw(qsearch qsearchs); #use FS::svc_acct_sm; diff --git a/fs_passwd/fs_passwd_server b/fs_passwd/fs_passwd_server index c15c9405d..f4b67ae98 100755 --- a/fs_passwd/fs_passwd_server +++ b/fs_passwd/fs_passwd_server @@ -12,7 +12,7 @@ use strict; use IO::Handle; -use FS::SSH qw(sshopen2); +use Net::SSH qw(sshopen2); use FS::UID qw(adminsuidsetup); use FS::Record qw(qsearchs); use FS::svc_acct; diff --git a/fs_signup/fs_signup_server b/fs_signup/fs_signup_server index 86455a477..8fbc819ad 100755 --- a/fs_signup/fs_signup_server +++ b/fs_signup/fs_signup_server @@ -6,7 +6,7 @@ use strict; use IO::Handle; use Tie::RefHash; -use FS::SSH qw(sshopen2); +use Net::SSH qw(sshopen2); use FS::UID qw(adminsuidsetup); use FS::Record qw( qsearch qsearchs ); use FS::cust_main_county; diff --git a/htdocs/docs/install.html b/htdocs/docs/install.html index af5251d5d..d94ffe7fa 100644 --- a/htdocs/docs/install.html +++ b/htdocs/docs/install.html @@ -32,6 +32,9 @@ Before installing, you need:
  • Text-Template
  • DBI
  • DBD for your database engine +
  • DBIx-DBSchema +
  • Net-SSH +
  • Net-SCP Install the Freeside distribution: -- 2.11.0