Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- upload(){
- if [ $? -eq 0 ]; then
- echo "now rebooting $1"
- ssh root@$1 reboot
- fi
- }
- while read ip; do
- echo "reboot $ip"
- upload "$ip"
- done <$1
- 10.1.30.235
- 10.1.30.1
- reboot 10.1.30.235
- now rebooting 10.1.30.235
- reboot 10.1.30.1
- now rebooting 10.1.30.1
- reboot 10.1.30.235
- now rebooting 10.1.30.235
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement