Remove ssh_helper

This commit is contained in:
Austen Adler 2019-01-08 11:44:33 -05:00
parent 0460cd7b98
commit b14c6240de

View File

@ -174,32 +174,3 @@ if [ "$ARG" = "clip" ]; then
gpaste-client select "$INDEX"
fi
fi
if [ "$ARG" = "ssh_helper" ]; then
if [ -f /proc/net/wireless ]; then
WIRELESS_DEV="$(perl -ne 'print if s/(\w+):.*/\1/' </proc/net/wireless)"
SSID="$(iw dev $WIRELESS_DEV link | perl -ne 'printf if s/\s*SSID: //')"
elif command -v iwgetid >/dev/null; then
SSID="$(iwgetid wlan0 -r)"
elif command -v nmcli >/dev/null; then
SSID="$(nmcli -t -f active,ssid dev wifi | perl -ne 'print if s/yes://;')"
elif command -v termux-wifi-connectioninfo >/dev/null; then
# Android device (termux)
SSID="$(termux-wifi-connectioninfo | perl -ne 'print if s/^\s*"ssid": "(.+)",$/\1/')"
fi
case "$(hostname)" in
sgen|egen|runner2)
SSID=ATTskUYuI2
;;
esac
logger "Found SSID for $(hostname): $SSID"
case "$SSID" in
ATTskUYuI2)
logger "ssh -q -W ${1} 192.168.1.200"
ssh -q -W "${1}" 192.168.1.200
;;
*)
logger "ssh -q -W ${1} -p 23 austenwares.com"
ssh -q -W "${1}" -p 23 austenwares.com
;;
esac
fi