Tuesday, February 9, 2010

SSH Launcher

#!/bin/bash
echo Select the hostname to SSH
HOSTS=/home/psychotux/scripts/conf/hosts.txt
cat $HOSTS | cut -f3 -d'|'
read host
echo Enter your username number
IP=`grep $host $HOSTS | cut -f2 -d'|'`
ssh "$user"@$IP

Note: /home/psychotux/scripts/conf/hosts.txt will be a file with values HOSTNAME and IP ADDRESS separated by "|"

No comments: