Created
February 8, 2017 10:52
-
-
Save abhilash1in/01812f050677081a9c5568f4a84afc00 to your computer and use it in GitHub Desktop.
Reboot systems over SSH
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
USERNAME=5c | |
HOST="172.1.4." | |
SCRIPT="echo aryabhatta | sudo -S reboot" | |
for i in {59..67} ; do | |
sshpass -p"aryabhatta" ssh -o StrictHostKeyChecking=no ${USERNAME}@${HOST}$i "${SCRIPT}" | |
done | |
for i in {69..150} ; do | |
sshpass -p"aryabhatta" ssh -o StrictHostKeyChecking=no ${USERNAME}@${HOST}$i "${SCRIPT}" | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment