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
}
I am sure this script could be done better. If you enhance it, post it here.
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
}
Copy it to
/etc/cron.daily/<give it a name>
and make it executable:
chmod +x /etc/cron.daily/<name given>
Thanks, I will install it!
Danke. Werde es installieren!
Hi Michaa7:
Was muss ich zufügen, um auch Pepperflash zu updaten?
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.
hm, schade.
Ich bin da sowas von Laie was das scripten angeht. Hatte die Hoffnung, dass man den apt Befehl integrieren könnte.
update-pepperflashplugin-nonfree --install --unverified
Danke für Deine Zeit und die Antwort!
Ich habe das script ja auch mit hilfe von anderen zusammengeschustert, bin also was scripte angeht totaler anfänger.
Kennst du eine möglichkeit die neueste version abzufragen?
Wenn überhaupt dann sollte man ein zweites script für pepper zusammenbauen. Ich habe pepper nicht installiert, aber du kannst ja einfach bei dir nachschauen ob der pepper plugin updater die gleichen oder ähnliche kommandos bereithält. Dann könntest du das script mit jedem texteditor selber umarbeiten.
Hallo,
den Flashplayer benutze ich zwar nicht, kann aber einen Code-Schnipsel für den Download beitragen:
(Das Script testet, ob entweder curl oder wget vorhanden bzw. ausführbar ist):
if [[ -x /usr/bin/curl ]] ; then
printf "downloading "; curl -sS https://www.adobe.com/products/flashplayer/distribution3.html | grep -o 'Flash.*(Linux)'
curl -So install_flash_player_11_linux.x86_64.tar.gz https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/install_flash_player_11_linux.x86_64.tar.gz
elif [[ -x /usr/bin/wget ]] ; then
printf "downloading "; wget -qO- https://www.adobe.com/products/flashplayer/distribution3.html | grep -o 'Flash.*(Linux)'
wget -Nc https://fpdownload.macromedia.com/get/flashplayer/current/licensing/linux/install_flash_player_11_linux.x86_64.tar.gz
else
printf "Weder curl noch wget sind installiert: Kein Download.\n"
fi
Mit dem grep wird die aktuell verfügbare Version angezeigt.
Hmm, man könnte die Versionsnummer zum Dateinamen hinzufügen ... future extension.
Grüße
musca
soweit es um Lanzis anliegen geht codeschnippselst du ca. um 100% bis 200% am gesuchten vorbei.
;)
aber falls es als erweiterung für mein script gedacht war, dann danke.
sorry lanzi, das bezieht sich auf michaa7's Script.
Bitte noch diese Variablen vor das erste Codefragment setzen:
kernel="$(uname -r)";
arch=${kernel##*-}
if [[ $arch == i386 ]] ; then
filename="i386"
elif [[ $arch == amd64 ]] ; then
filename="x86_64"
fiNun sind wir architekturunabhängig und können im ersten Codefragment überall x86_64 durch ${filename} ersetzen.
Der Dateiname lautet dannn z.B.
"install_flash_player_11_linux.${filename}.tar.gz"hmm, die Versionsnummer bleibt noch zu ergänzen.
Grüße
musca
Hallo (michaa7),
mal abgesehen davon, dass das update zur Zeit kaum funktioniert (manuell schon), hab ich mal ne Frage zum script.
Bei mir bekomme ich immer eine Fehler Meldung
/etc/cron.daily# ./flash
./flash: 83: ./flash: Syntax error: end of file unexpected (expecting "fi")
und als Nichtscripter komme ich dahinter, wie das beheben kann....an Ende steht doch fi ???
Da scheint dir beim Kopieren etwas abhanden gekommen zu sein. Ich hab die Datei gerade mal runter geladen und bei mir läuft es (wenn auch mit Fehler wegen wget)
ja das hatte ich auch gedacht, aber ich sehe da nix was fehlt.
so sah die nicht funktionierende Version aus - auf der Konsole mit vi erstellt
cat /etc/cron.daily/flash
#!/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
}
so funktioniert es, es gibt keinen Fehler mehr - mit Texteditor (kwrite) neu erstellt :-\
cat /etc/cron.daily/flash
#!/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
}
Hast Du auf die Beiden mal ein diff laufen lassen? So beim groben überfliegen sehe ich nämlich keinen Unterschied bis auf die Formatierung. Evtl. sind ja irgendwelche nicht druckbaren Zeichen mit rein geraten.
thanks!
If you want to update to the last adobe flash plugin BETA, you can use this script:
cd /tmp
wget https://fpdownload.macromedia.com/pub/labs/flashruntimes/flashplayer/linux64/flash_player_ppapi_linux.x86_64.tar.gz
tar -zxvf flash_player_ppapi_linux.x86_64.tar.gz
cp ./libpepflashplayer.so /usr/lib/flashplugin-nonfree/
mv ./libpepflashplayer.so /usr/lib/pepperflashplugin-nonfree/
# update-pepperflashplugin-nonfree --install
# update-pepperflashplugin-nonfree --status
wget https://fpdownload.macromedia.com/pub/labs/flashruntimes/flashplayer/linux64/flash_player_npapi_linux.x86_64.tar.gz
tar -zxvf flash_player_npapi_linux.x86_64.tar.gz
mv ./libflashplayer.so /usr/lib/firefox/browser/plugins/