Last active
May 29, 2017 12:21
-
-
Save xezpeleta/cb1611f2d7641a519410d69fe29dcb67 to your computer and use it in GitHub Desktop.
Ubuntu server: reboot on "system restart required" with CRON
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/sh -e | |
# | |
# File: /etc/cron.daily/reboot-when-required | |
# Description: reboots the machine if its required | |
if [ -f /var/run/reboot-required ]; then | |
shutdown -r +5 "Reboot required. System will be restarted in 5min." | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Copy this file under
/etc/cron.daily
directory