]> git.sesse.net Git - nms/blobdiff - web/ssendfile.pl
Update make-switches.pl for TG07.
[nms] / web / ssendfile.pl
index 4ec7104ce1875ac2b461cdd8d7ac61f2cb11734c..5347dd2193b0ce6f86cea58a8e9d91a8e700bfda 100755 (executable)
@@ -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 (<CONFIG>) {
 #              }
 #      }
 #      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";