Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ssh 192.168.64.131 cat /scripts/free_hosts.sh
- #!/bin/sh
- /usr/bin/com-dsh -v hostname -f 2> /root/free_hosts
- FILE="/root/free_hosts"
- if [[ -s $FILE ]] ; then
- /usr/bin/grep Iuclid* /root/free_hosts | /usr/bin/sed -n 1p | awk '{printf $1 " "}' > /root/add_host
- HOSTNAME=`cat /root/add_host`
- /bin/echo "Next free Host:"
- echo $HOSTNAME
- /bin/echo "-----------------"
- IP=`/usr/bin/grep -i $HOSTNAME /etc/hosts | /usr/bin/awk '{printf $1 " "}'`
- /bin/echo "IP is:"
- /bin/echo $IP
- else
- echo "No free Node available. Please contact TechniData Datacenter!"
- fi ;
- exit
Add Comment
Please, Sign In to add comment