sub getFiles{ ### ftp constants ########### my $ip = @_[0]; my $dir = '/ata00'; my $user = 'xxxxx'; my $pass = 'xxxxx'; my $dbg = 0; if ($debug) {print "\tConnecting to $ip\n "; $dbg = 1; } if(CMTScheck($ip)){ return 1;} #if CMTS cannot be contacted via SNMP, die $ftp = Net::FTP->new("$ip", Debug => $dbg) or $error=1; #initialize connection if($error){ #if error, quit print "\tServer is not responding\n"; return 1; } ##### Login ############# $ftp->login("$user","$pass") or $error=1; if($error){ print "Username and Password not accepted"; $ftp->quit; return 1; } $ftp->binary; #set binary mode $ftp->cwd('/ata00'); #change to /ata00 dir #### Retrieve files ######### $ftp->get('dhcpd.con') or $error=1; if($error){ print "Could not retrieve dhcpd.con...... quitting"; $ftp->quit; return 1; } $ftp->get('smsact.db') or $error=1; if($error){ print "Could not retrieve smsact.db...... quitting"; $ftp->quit; return 1; } $ftp->quit; return 0; }