Add security-updates-check.sh script (sends mail notifications)
This commit is contained in:
parent
f031809f13
commit
da243f92d7
19
security-updates-check.sh
Executable file
19
security-updates-check.sh
Executable file
@ -0,0 +1,19 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
UPDATES=$(arch-audit --upgradable | sed "{s/\n/<br>/g}")
|
||||||
|
|
||||||
|
if test "$1" != "true"
|
||||||
|
then
|
||||||
|
UPDATES=$(echo -e "$UPDATES" | grep -v "testing repos\!")
|
||||||
|
fi
|
||||||
|
|
||||||
|
echo -e "$UPDATES"
|
||||||
|
|
||||||
|
HOST=$(hostname)
|
||||||
|
DEST=$(cat ~/.admin_mail)
|
||||||
|
|
||||||
|
if [ ! -z "$UPDATES" ]; then
|
||||||
|
echo -e "The following security updates are available for $HOST:\n\n$UPDATES\n\nIt is highly recommended that you perform these updates now" | mailx -s "Security updates are available on $HOST" $DEST
|
||||||
|
echo "Mail sent"
|
||||||
|
fi
|
||||||
|
|
Loading…
Reference in New Issue
Block a user