dotfiles/config/i3/sshmenu

10 lines
282 B
Plaintext
Raw Normal View History

2016-12-09 21:52:34 +01:00
#!/bin/sh
2016-12-11 08:12:15 +01:00
if [ "$1" == 'root' ]; then
a=" (root)"
b="sudo -E "
fi
machine=$(cat ~/.ssh/config | grep '^Host ' | cut -d ' ' -f 2 | grep -v '*' | sort | $HOME/.config/i3/dmenu_cmd -p "SSH$a to ")
if [ ! -z $machine ]; then
xterm -e "ssh $machine -t '${b}bash --login'"
2016-12-11 08:12:15 +01:00
fi