projects
/
dell-switch
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
9842667
)
resolve hostname as argument
author
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 28 Jun 2018 18:08:29 +0000
(20:08 +0200)
committer
Dobrica Pavlinusic
<dpavlin@rot13.org>
Thu, 28 Jun 2018 18:08:29 +0000
(20:08 +0200)
dell-switch.pl
patch
|
blob
|
history
diff --git
a/dell-switch.pl
b/dell-switch.pl
index
efff4ba
..
f314132
100755
(executable)
--- a/
dell-switch.pl
+++ b/
dell-switch.pl
@@
-17,6
+17,7
@@
require 'config.pl';
#$Net::OpenSSH::debug = ~0;
my $ip = shift @ARGV || die "usage: $0 IP command[ command ...]\n";
+$ip = $1 if `host $ip` =~ m/has address (\S+)/;
my @commands = @ARGV;
@commands = <DATA> unless @commands;