diff options
author | Kristian Lyngstol <kly@kly@.no> | 2016-03-26 03:48:32 +0100 |
---|---|---|
committer | Kristian Lyngstol <kly@kly@.no> | 2016-03-26 03:48:32 +0100 |
commit | cda4d1235486dc74c5d3630fc5e85307f277c5f3 (patch) | |
tree | 0e59890e8afcf09024079d0e3a596e16b63250af /clients/ssendfile.pl | |
parent | 004f4efcfd0779f4307b90fed139dc87d01ad0b9 (diff) | |
parent | a791ca16c787672ea534dbde39f926d0341aa2e6 (diff) |
Merge branch 'master' of github.com:tech-server/tgmanage
Diffstat (limited to 'clients/ssendfile.pl')
-rwxr-xr-x | clients/ssendfile.pl | 50 |
1 files changed, 0 insertions, 50 deletions
diff --git a/clients/ssendfile.pl b/clients/ssendfile.pl deleted file mode 100755 index 224f4e2..0000000 --- a/clients/ssendfile.pl +++ /dev/null @@ -1,50 +0,0 @@ -#!/usr/bin/perl -use warnings; -use strict; -use lib '../include'; -use POSIX; - -my $delaytime = 30; -my $poll_frequency = 60; - -sub mylog { - my $msg = shift; - my $time = POSIX::ctime(time); - $time =~ s/\n.*$//; - printf STDERR "[%s] %s\n", $time, $msg; -} - -if ($#ARGV != 1) { - die("Error in arguments passed\n". - "./ssendfile.pl addr configfile\n"); -} - -my $ssh = nms::switch_connect_ssh($ARGV[0]); -my $conn = $ssh->{telnet}; -if (!defined($conn)) { - die("Could not connect to switch.\n"); -} - -open(CONFIG, $ARGV[1]); -while (<CONFIG>) { - my $cmd = $_; - $cmd =~ s/[\r\n]+//g; - print "Executing: `$cmd`\n"; -# if ($cmd =~ /ip ifconfig swif0 (\d{1-3}\.\d{1-3}\.\d{1-3}\.\d{1-3})/) { -# print "New ip: $1\n"; -# $conn->cmd( String => $cmd, -# Timeout => 3); -# $ssh = nms::switch_connect_ssh($1); -# $conn = $ssh->{telnet}; -# if (!defined($conn)) { -# die "Could not connect to new ip: $1\n"; -# } -# } -# else { - my @data = nms::switch_exec($cmd, $conn); - foreach my $line (@data) { - $line =~ s/[\r\n]+//g; - print "$line\n"; - } -# } -} |