Skip to content

Instantly share code, notes, and snippets.

@blackknight36
Last active February 4, 2019 15:02
Show Gist options
  • Save blackknight36/f92ad4ddbba3a3b7d961e6aa629c7499 to your computer and use it in GitHub Desktop.
Save blackknight36/f92ad4ddbba3a3b7d961e6aa629c7499 to your computer and use it in GitHub Desktop.
#!/bin/bash
# This script generates a command which can be used to reboot a server at a random time between 3:00 AM and 6:59 AM.
hour=`printf "%02d" $(shuf -i 3-6 -n 1)`
minute=`printf "%02d" $(shuf -i 00-59 -n 1)`
reboot_time="$hour:$minute"
echo "shutdown -r $reboot_time"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment