Added mail send
This commit is contained in:
parent
7be8a13889
commit
0a1f908287
1 changed files with 3 additions and 3 deletions
|
@ -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.
|
# 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.
|
# 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
|
fi
|
||||||
|
|
||||||
if [ -z "$key_packages" ]; then
|
if [ -z "$key_packages" ]; then
|
||||||
key_packages=( "ssh" "ssl" "apache" "kernel" )
|
key_packages=( "ssh" "ssl" "apache" "kernel" "linux-image" "syncthing" "wireguard" )
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
@ -57,5 +57,5 @@ done
|
||||||
if [ -n "$output" ]; then
|
if [ -n "$output" ]; then
|
||||||
output="The Apt Update Watcher has been triggered.\n\n""$output"
|
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
|
fi
|
||||||
|
|
Loading…
Add table
Reference in a new issue