don't save files without command (prompt only)
authorDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Sep 2015 17:41:53 +0000 (19:41 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Thu, 17 Sep 2015 17:41:53 +0000 (19:41 +0200)
dell-switch.pl

index 5b9109c..a4fc2bb 100755 (executable)
@@ -44,6 +44,8 @@ chdir 'log';
 
 sub save_log {
        my ($ip, $hostname, $command, $buff) = @_;
+
+       return unless $command;
        
        my $file = "${ip}_${hostname}_${command}.log";
        open my $log, '>', $file;