Advertisement
Guest User

Untitled

a guest
Jun 27th, 2019
61
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.34 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. upload(){
  4. if [ $? -eq 0 ]; then
  5. echo "now rebooting $1"
  6. ssh root@$1 reboot
  7. fi
  8. }
  9.  
  10. while read ip; do
  11. echo "reboot $ip"
  12. upload "$ip"
  13. done <$1
  14.  
  15. 10.1.30.235
  16. 10.1.30.1
  17.  
  18. reboot 10.1.30.235
  19. now rebooting 10.1.30.235
  20. reboot 10.1.30.1
  21. now rebooting 10.1.30.1
  22.  
  23. reboot 10.1.30.235
  24. now rebooting 10.1.30.235
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement