Guest User

Untitled

a guest
Feb 20th, 2018
73
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. ssh 192.168.64.131 cat /scripts/free_hosts.sh
  2. #!/bin/sh
  3. /usr/bin/com-dsh -v hostname -f 2> /root/free_hosts
  4.  
  5. FILE="/root/free_hosts"
  6.  
  7. if [[ -s $FILE ]] ; then
  8.  
  9. /usr/bin/grep Iuclid* /root/free_hosts | /usr/bin/sed -n 1p | awk '{printf $1 " "}' > /root/add_host
  10.  
  11. HOSTNAME=`cat /root/add_host`
  12. /bin/echo "Next free Host:"
  13.  
  14. echo $HOSTNAME
  15.  
  16. /bin/echo "-----------------"
  17. IP=`/usr/bin/grep -i $HOSTNAME /etc/hosts | /usr/bin/awk '{printf $1 " "}'`
  18. /bin/echo "IP is:"
  19. /bin/echo $IP
  20.  
  21. else
  22. echo "No free Node available. Please contact TechniData Datacenter!"
  23. fi ;
  24.  
  25. exit
Add Comment
Please, Sign In to add comment