Commit 9ec3a3e 1 parent 358c8c1 commit 9ec3a3e Copy full SHA for 9ec3a3e
File tree 1 file changed +13
-1
lines changed
1 file changed +13
-1
lines changed Original file line number Diff line number Diff line change @@ -30,8 +30,20 @@ if [ -e "${ssh_user_config}" ] && { [ -z "${SSH_AUTH_SOCK}" ] || [ -z "${SSH_AGE
30
30
unset_ssh_agent=true
31
31
fi
32
32
33
+ # numerical host, issue #19
34
+ if [[ " $1 " == " -n" * ]] ; then
35
+ machine_list=" ${git_tld} /_dsh_config/${pump_name} .list"
36
+ if [ ! -e " ${machine_list} " ]; then
37
+ echo " [ERROR] dsh machine list does not exist (${machine_list} )."
38
+ exit 4
39
+ fi
40
+ hostname=" $( head ${1} ${machine_list} | tail -n1) "
41
+ echo " Host ${1} --> ${hostname} "
42
+ shift
43
+ fi
44
+
33
45
# shellcheck disable=SC2086,SC2029
34
- ssh ${ssh_args} " $@ "
46
+ ssh ${ssh_args} ${hostname} " $@ "
35
47
36
48
# Clean up ssh-agent
37
49
if [ " ${unset_ssh_agent} " = " true" ] && [ -n " ${SSH_AGENT_PID} " ]; then
You can’t perform that action at this time.
0 commit comments