Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/sh
- SERVERLIST=$1
- if [[ -z $SERVERLIST ]]; then
- cat <<-End-of-message
- server list file not found ...
- usage: ./ivan.sh serverlist.txt
- End-of-message
- elif [[ ! -e $SERVERLIST ]]; then
- echo "File $1 does not exist. Please provide a valid server list filename"
- else
- while read LINE; do
- status=$(ssh -n -o BatchMode=yes -o ConnectTimeout=5 -i ./.vagrant/machines/node`echo $LINE | awk -F. {'print $4'}`/virtualbox/private_key vagrant@$LINE 2>&1)
- if [ $? -ne 0 ]
- then
- echo "connection not successful in $LINE"
- else
- echo "connection successful in $LINE"
- fi
- done < $SERVERLIST
- fi
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement