print update instructions
authorDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Aug 2022 12:34:43 +0000 (14:34 +0200)
committerDobrica Pavlinusic <dpavlin@rot13.org>
Sun, 14 Aug 2022 12:34:43 +0000 (14:34 +0200)
neighbours.pl

index e4279a0..e9d960b 100755 (executable)
@@ -2,12 +2,18 @@
 use warnings;
 use strict;
 use autodie;
+use Data::Dump qw(dump);
 
-# ./sw-name-mac.sh
-# ./sw-names | xargs -i ./dell-switch.pl {} 'show lldp neighbors'
-# /home/dpavlin/mikrotik-switch/m-neighbour
+if ( $ARGV[0] eq 'update' ) {
+       print <<__SH__
+./sw-name-mac.sh
+./sw-names | xargs -i ./dell-switch.pl {} 'show lldp neighbors'
+/home/dpavlin/mikrotik-switch/m-neighbour
+__SH__
+       ;
+       exit 0;
+};
 
-use Data::Dump qw(dump);
 
 my $debug = $ENV{DEBUG} || 0;
 
@@ -30,6 +36,7 @@ while(<$f>) {
 
 sub mac2name {
        my ( $mac, $name ) = @_;
+       return unless defined $mac;
 
        $mac = lc($mac);