#1 Le 11/02/2010, à 16:33
- sputnick
Script de maj flashplayer automatique
Salut,
je vous propose ce petit script ( commenté ) de rien du tout pour mettre à jour flash régulièrement :
#!/usr/bin/env bash
#
# ------------------------------------------------------------------
# made by sputnick in da FreAkY lApPy lAb (c) 2009
# gilles.quenot <AT> gmail <DOT> com
#
# This program is free software; you can redistribute it and/or
# modify it under the terms of version 2 of the GNU General Public
# License published by the Free Software Foundation.
# (see http://www.gnu.org/licenses/gpl.html).
# ------------------------------------------------------------------
# ,,_
# o" )@
# ''''
# ------------------------------------------------------------------
# Met à jour flashplayer pour la plupart des browsers
# version majeure de libflashplayer courante. Ca ne change pas souvent :
currentMajorVersion=10
# Chemins ou le script va installer la lib
libFlashPlayerPaths="/home/*/mozilla/plugins /usr/lib/mozilla/plugins"
trap 'echo >&2 "Error while installing last flashplayer"' ERR
# Si on lance le script la premiere fois, le fichier temoin est créé
[[ -s ~/.flashplayerupdate.etag ]] || :> ~/.flashplayerupdate.etag
# On recupere l'ancien Etag
oldEtag=$(< ~/.flashplayerupdate.etag)
# On recupere le nouvel Etag
newEtag=$(
curl -sI http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_${currentMajorVersion}_linux.tar.gz | \
awk -F'"' '/^ETag:/ {print $2}'
)
# On teste si le Etag est different de la derniere fois
# que le script a été lancé.
# CF->http://en.wikipedia.org/wiki/HTTP_ETag
[[ $oldEtag == $newEtag ]] && exit 0
cd /tmp
wget >/dev/null http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_${currentMajorVersion}_linux.tar.gz || \
echo >&2 "wget failed."
tar zxf install_flash_player_${currentMajorVersion}_linux.tar.gz
for i in $libFlashPlayerPaths; do
install -D ./libflashplayer.so "$i/libflashplayer.so"
done
echo "$newEtag" > ~/.flashplayerupdate.etag
\rm install_flash_player_* libflashplayer.so
A mettre en crontab root 2 fois par semaine çà me semble tout à fait suffisant.
Perso j'ai cela :
00 00 * * 1,5 /bin/bash ~sputnick/bin/flashplayerupdate.bash
Soit une maj le lundi et le vendredi à minuit.
Je sais, un peu partout, tout le monde s'entretue, c'est pas gai, mais d'autres s'entrevivent, j'irai les retrouver. Jacques Prévert
https://sputnick.fr
Hors ligne