X-Git-Url: https://git.sesse.net/?a=blobdiff_plain;f=web%2Fssendfile.pl;h=5347dd2193b0ce6f86cea58a8e9d91a8e700bfda;hb=6f01d8d8981b4a668709516f75a482588a66c4ba;hp=4ec7104ce1875ac2b461cdd8d7ac61f2cb11734c;hpb=9180f8278b332f8eb6c65a11d6f284f5facf6722;p=nms diff --git a/web/ssendfile.pl b/web/ssendfile.pl index 4ec7104..5347dd2 100755 --- a/web/ssendfile.pl +++ b/web/ssendfile.pl @@ -7,22 +7,6 @@ use POSIX; my $delaytime = 30; my $poll_frequency = 60; -# Send a command to switch and return the data recvied from the switch -sub switch_exec($$) { - my ($cmd, $conn) = @_; - - # Send the command and get data from switch - my @data = $conn->cmd($cmd); - my @lines = (); - foreach my $line (@data) { - # Remove escape-7 sequence - $line =~ s/\x1b\x37//g; - push (@lines, $line); - } - - return @lines; -} - sub mylog { my $msg = shift; my $time = POSIX::ctime(time); @@ -55,7 +39,7 @@ while () { # } # } # else { - my @data = switch_exec($cmd, $conn); + my @data = nms::switch_exec($cmd, $conn); foreach my $line (@data) { $line =~ s/[\r\n]+//g; print "$line\n";