1
0
Fork 0

Added mail send

This commit is contained in:
trotFunky 2020-05-17 15:24:45 +01:00
parent 7be8a13889
commit 0a1f908287

View file

@ -1,4 +1,4 @@
#! /bin/bash
#!/bin/bash
# This script updates the apt database if running as root and retrieves the number of upgradable packages.
# If the count is high enough or if some important packages can be upgraded, inform the administrator.
@ -30,7 +30,7 @@ if [ -z "$trigger_count" ]; then
fi
if [ -z "$key_packages" ]; then
key_packages=( "ssh" "ssl" "apache" "kernel" )
key_packages=( "ssh" "ssl" "apache" "kernel" "linux-image" "syncthing" "wireguard" )
fi
@ -57,5 +57,5 @@ done
if [ -n "$output" ]; then
output="The Apt Update Watcher has been triggered.\n\n""$output"
echo -e "$output" # Can be replaced by anything or piped into sendmail
echo -e "$output" | mail -aFrom:"$mail_sender" -s "[$(uname -n)] APT update warning $(date +%D-%Hh%M)" "$mail_recipients"
fi