about summary refs log tree commit diff stats
path: root/mrgrctrnl
diff options
context:
space:
mode:
authorCase Duckworth2020-04-26 08:20:30 -0500
committerCase Duckworth2020-04-26 08:20:30 -0500
commit7b5d702e202e3e3b6d00670ecd670505071a4f54 (patch)
treeb7122deaa26fdfb1fb0a7db07beccf0b4079cc8d /mrgrctrnl
parentAdd Uninstall info (diff)
downloadmrgrctrnl-7b5d702e202e3e3b6d00670ecd670505071a4f54.tar.gz
mrgrctrnl-7b5d702e202e3e3b6d00670ecd670505071a4f54.zip
Add key and rest fields and improve ssh calls
Diffstat (limited to 'mrgrctrnl')
-rwxr-xr-xmrgrctrnl11
1 files changed, 8 insertions, 3 deletions
diff --git a/mrgrctrnl b/mrgrctrnl index 1229993..ca17f55 100755 --- a/mrgrctrnl +++ b/mrgrctrnl
@@ -70,19 +70,24 @@ then demolish_tunnels
70fi 70fi
71 71
72awk '{sub(/#.*$/,"");print}' "$config" | 72awk '{sub(/#.*$/,"");print}' "$config" |
73while read -r machine user local remote 73while read -r machine user local remote key rest
74do 74do
75 if [ -z "$machine" ] || [ -z "$user" ] || 75 if [ -z "$machine" ] || [ -z "$user" ] ||
76 [ -z "$local" ] || [ -z "$remote" ] 76 [ -z "$local" ] || [ -z "$remote" ]
77 then continue 77 then continue
78 fi 78 fi
79 79
80 echo ssh -N "$user@$machine" -L "$local:$remote" 80 set -- -N "$user@$machine" -L "$local:$remote"
81 [ -n "$key" ] && set -- "$@" -i "$key"
82 #shellcheck disable=2086
83 [ -n "$rest" ] && set -- "$@" $rest
84
85 echo ssh "$@"
81 86
82 "$dry_run" || { 87 "$dry_run" || {
83 while : 88 while :
84 do 89 do
85 ssh -N "$user@$machine" -L "$local:$remote" 90 ssh "$@"
86 echo "$!" >> "$pidf" 91 echo "$!" >> "$pidf"
87 sleep 5 92 sleep 5
88 done & 93 done &