scripts

random assortment of scripts
git clone git://git.andersuno.nu/scripts.git
Log | Files | Refs

sshconnect.sh (460B)


      1 #!/bin/sh
      2 # Give dmenu list of hosts to connect to via ssh
      3 # Change terminator to your preferred terminal emulator
      4 
      5 # Format for sshhosts.txt:
      6 # <IP> <Optional, Searchable Description>
      7 # 10.0.0.1 Webserver
      8 
      9 # Prepend entry with "#" to disable
     10 
     11 machine=$(grep -v "#" ~/.config/sshhosts.txt | dmenu -i -l 20 -fn Monospace-18 | cut -d' ' -f1)
     12 
     13 [ "$machine" != "" ] || exit
     14 
     15 user=$(echo "anders
     16 root" | dmenu -p "Connect as: ")
     17 
     18 terminator -e "ssh $user@$machine"