Thanks absolut for the initial idea and pointing out how to enhance the script.
Thanks to the guys on debianforum.de for helping me with this script.
This script is a replacement for absolut's above mentioned cronjob script to automaticaly check and install "flashplugin-nonfree" whenever a new version is available. As seen repeatedly in the past, a due update may fail, for example in consequence of a not updated checksum on the server.
People using this new script will now get an email (to root!) *if* a new version is available but install did fail. You should then look deeper into it and see whether it is appropriate to file a bug report.
You need to copy it to /etc/cron.daily/<give it a name> and to make it executable (chmod +x /etc/cron.daily/<name given>).
#!/bin/sh
# de
##########################################################################################################
# testen ob update-flashplugin-nonfree verfügbar/ausführbar ist
# updater ausführen;
# anschließend den status überprüfen und die entsprechenden zeilen mit grep ausfiltern
# Versionsnummer der installierten und entfernt verfügbare Version einlesen und vergleichen
# Wenn gleich nichts tun, wenn verschieden dann Mail an root.
# (Sinnvollerweise wäre konfiguriert dass root Mails generell an einen echten User weitergeleitet werden)
##########################################################################################################
# en
##########################################################################################################
# test whether update-flashplugin-nonfree is available / executable
# execute updater
# test installation status and grep installed and newest available version
# read installed and remotly available version. If equal do nothing, if different send mail to root
# (you should have configured to forward mails to root to a real user)
##########################################################################################################
test -x /usr/sbin/update-flashplugin-nonfree \
&& /usr/sbin/update-flashplugin-nonfree --install --quiet \
&& update-flashplugin-nonfree --status | grep -o ": [[:digit:]]*.[[:digit:]]*.[[:digit:]]*.[[:digit:]]*"\
| {
read installed
read available
if [ "x$installed" = "x$available" ] ; then
:
else
mail -s "flashupdate fehlgeschlagen / failed" root <<EOM
Hallo Admin,
Das flashupdate ist fehlgeschlagen.
Mit freundlichem Gruss
updatescript
Hello admin,
updating flash failed
Bye
updatescript
EOM
fi
}
I am sure this script could be done better. If you enhance it, post it here.