Siduction Forum > Ideas & Improvements
[EN] new flash update script (cronjob)
michaa7:
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>).
--- Quote ---#!/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
}
--- End quote ---
I am sure this script could be done better. If you enhance it, post it here.
michaa7:
I think a howto-d/l-and-install-flashplugin-nonfree-manually may come handy in the mail you get. So I added it to the script.
--- Quote ---#!/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.
Manuelles update siehe unten.
Mit freundlichem Gruss
updatescript
Hello admin,
updating flash failed
Howto update manually see below.
Bye
updatescript
#****************************************************************************************
#
# manuales update / manual update:
# Gehe zu / go to: http://get.adobe.com/de/flashplayer/
#
# dl tar file (32 or 64 bit in abhängikeit bon deinem system)
#
# dann / then:
#
## 32 bit
# tar -xf install_flash_player_11_linux.i386.tar.gz
# chown root:root libflashplayer.so
# chown -R root:root usr # no "/" in front of usr
# chown root:root readme.txt # you won't copy it, so I mention it just for completeness
# cp -r usr/* /usr
# cp libflashplayer.so /usr/lib/flashplugin-nonfree/
#
## 64 bit
# tar -xf install_flash_player_11_linux.x86_64.tar.gz
# chown root:root libflashplayer.so
# chown -R root:root usr # no "/" in front of usr
# chown root:root readme.txt # you won't copy it, so I mention it just for completeness
# cp -r usr/* /usr
# cp libflashplayer.so /usr/lib/flashplugin-nonfree/
#
#****************************************************************************************
EOM
fi
}
--- End quote ---
Copy it to
/etc/cron.daily/<give it a name>
and make it executable:
chmod +x /etc/cron.daily/<name given>
Lanzi:
Thanks, I will install it!
Danke. Werde es installieren!
Lanzi:
Hi Michaa7:
Was muss ich zufügen, um auch Pepperflash zu updaten?
michaa7:
Das ist nicht machbar, weil das nicht so einfach irgendwo heruntergeladen werden kann:
https://wiki.debian.org/PepperFlashPlayer
Man kann das sicher auch irgendwie scripten, aber ich kenne mich da zu wenig aus.
Navigation
[0] Message Index
[#] Next page
Go to full version