21 lines
522 B
Bash
Executable File
21 lines
522 B
Bash
Executable File
#!/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"
|
|
|
|
if [ ! -z "$UPDATES" ]; then
|
|
HOST=$(hostname)
|
|
FROM=$(cat ~/.host_mail)
|
|
DEST=$(cat ~/.admin_mail)
|
|
|
|
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" -r "$FROM" $DEST
|
|
echo "Mail sent"
|
|
fi
|
|
|