Created
November 25, 2018 10:46
-
-
Save devtronic/bb65094acdbe74b704327e83b233d12a to your computer and use it in GitHub Desktop.
Automatic update check for ubuntu server with mail notification
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 | |
apt update | |
upgradeable_count=$(($( apt list --upgradeable | wc -l) - 1)) | |
if [ $upgradeable_count -gt 0 ]; then | |
apt list --upgradeable | mailx -s "$upgradeable_count Updates available at $(hostname)" [email protected] | |
fi; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
[email protected]
durch deine E-Mail-Adresse ändernchmod 775 check-updates.sh
ausführbar machen.crontab -e
ein eintsprechender crontab Eintrag erzeugen (https://crontab-generator.org/)