hello à tous,
voilà un script qui devrait vous permettre d’utiliser la dernière release de thunderbird sous bookworm pour ceux qui sont intéressés…
# verificateur de mise à jour thunderbird
#!/bin/bash
################################# variable à modifier ########################
## répertoire d'installation ##
REPINSTALL="/repertoire/thunderbird"
REPNEWINSTALL="/repertoire" ### (en fait c'est le même répertoire d'installation mais j'avais besoin d'une variable supplémentaire un niveau d'arborescence plus haut pour la décompression de l'archive de mise à jour)
## répertoire de sauvegarde des fichiers du profil ##
DEST=$HOME/backup_thunderbird
MOZARCHIVE=https://archive.mozilla.org/pub/thunderbird/releases/
ARCH=linux64
MYLANG=fr
##############################################################################
backup_profil(){
echo "=== Sauvegarde du profil Thunderbird ==="
read -p "Voulez-vous effectuer une sauvegarde du profil avant la mise à jour ? (O/n) : " reponse
if [[ "$reponse" =~ ^[Oo]$ ]]; then
tar -cf - $HOME/.thunderbird/ | pigz -9 -k > $DEST/backup_`date +%d`_`date +%h`_`date +%Y`_`date +%H`_`date +%M`_`date +%S`.tar.gz
else
echo "Aucune sauvegarde n'a été effectuée. Continuez à vos risques et périls."
fi
}
MAVERSIONTHUNDERBIRD=$("$REPINSTALL"/thunderbird -v | awk -F "Mozilla Thunderbird" '{ print }' | cut -d ' ' -f 3-) # attention, ici thunderbird c'est l'executable du répertoire thunderbird...
#echo "version actuelle de thunderbird : $MAVERSIONTHUNDERBIRD"
echo $MAVERSIONTHUNDERBIRD
echo -e "\n"
echo "vérification de l'existence d'une nouvelle version ..."
#https://archive.mozilla.org/pub/thunderbird/releases/143.0b2/linux-x86_64/fr/
cd tmp/; wget https://archive.mozilla.org/pub/thunderbird/releases/
VERSIONINTERNET=$(cat index.html | grep '/pub/thunderbird/releases/' | cut -d '/' -f5 | \
grep -E '^[0-9]+\.[0-9]+(b[0-9]+|rc[0-9]+)?$' | \
sort -V | tail -1)
echo $VERSIONINTERNET
cd ..
if [[ $(echo -e "$MAVERSIONTHUNDERBIRD\n$VERSIONINTERNET" | sort -V -r | head -1) == "$MAVERSIONTHUNDERBIRD" ]]; then
echo "tout est déjà à jour"
rm -f $HOME/tmp/index.html
else
echo "Mise à jour disponible ! nuouvelle version : $VERSIONINTERNET "
backup_profil
cd /home/$USER/tmp/
wget -O thunderbird-$VERSIONINTERNET "https://download.mozilla.org/?product=thunderbird-$VERSIONINTERNET-SSL&os=$ARCH&lang=$MYLANG"
#### à faire plus tard, verifier la signature des fichiers avec les *.asc
tar xf thunderbird-$VERSIONINTERNET -C /$REPNEWINSTALL
rm -f thunderbird-$VERSIONINTERNET
echo "vous aviez $MAVERSIONTHUNDERBIRD"
echo "Nouvelle version installé : "
/opt/thunderbird/thunderbird -v
rm -f $HOME/tmp/index.html
fi