Created
October 9, 2017 08:06
-
-
Save wangsha/51fa53ae45fc0846f75af061699316b7 to your computer and use it in GitHub Desktop.
Monit script auto check and update packages
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
check program outdated-package-test with path "/usr/bin/apt-get -u upgrade --assume-no" | |
if status != 0 then exec "DEBIAN_FRONTEND=noninteractive /usr/bin/apt-get -y -o DPkg::options::='--force-confdef' -o DPkg::options::='--force-confold' install grub-pc" | |
if status != 0 for 2 cycles then exec "/usr/bin/apt-get upgrade -y --force-yes -qq" | |
if status != 0 for 5 cycles then alert |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment