Created
February 25, 2016 14:44
-
-
Save biiont/c16cdd5a9052b0977915 to your computer and use it in GitHub Desktop.
Continiosly reboot target system by ssh until ssh returns connection error then beep.
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
CNT=1; ERR=0; while test $ERR -eq 0; do printf "Attempt: %3d at %s\n" $CNT "$(date)"; ssh -o 'VisualHostKey=no' [email protected] /sbin/reboot; ERR=$?; test $ERR -eq 0 && sleep $((2 * 60)); CNT=$CNT+1; done; test $ERR -ne 0 && printf "Failed with code %d at %s" $ERR "$(date)" && paplay /usr/share/sounds/freedesktop/stereo/alarm-clock-elapsed.oga |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment