This commit is contained in:
kyodev 2017-07-24 11:29:16 +02:00
parent 9e8fabb7db
commit 2b00f87c22
4 changed files with 218 additions and 207 deletions

View File

@ -26,7 +26,7 @@ chmod +x getFirefox && ./getFirefox
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.1 - 21/07/2017 pour Debian, version 1.0.0 - 24/07/2017
getFirefox installé dans le système. getFirefox installé dans le système.
maintenant, appel du script par: getFirefox (sans ./) maintenant, appel du script par: getFirefox (sans ./)
@ -88,7 +88,7 @@ lancer le script sans arguments: `getFirefox` ou avec l'option help `getFirefox
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.1 - 21/07/2017 pour Debian, version 1.0.0 - 24/07/2017
---------------------------------------------------------------------- ----------------------------------------------------------------------
./getFirefox : installation du script dans le système ./getFirefox : installation du script dans le système
@ -114,6 +114,7 @@ lancer le script sans arguments: `getFirefox` ou avec l'option help `getFirefox
Il désinstallera le *paquet Debian* firefox-esr si présent. Il désinstallera le *paquet Debian* firefox-esr si présent.
---------------------------------------------------------------------- ----------------------------------------------------------------------
plus d'infos: https://framagit.org/kyodev/kyopages/raw/master/scripts/getFirefox plus d'infos: https://framagit.org/kyodev/kyopages/raw/master/scripts/getFirefox
``` ```
@ -132,7 +133,7 @@ getFirefox i-latest
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.1 - 21/07/2017 pour Debian, version 1.0.0 - 24/07/2017
_.-~-. _.-~-.
7'' Q..\ 7'' Q..\
@ -148,30 +149,37 @@ getFirefox i-latest
/..\ /..\__/ ' '::: | | | | | | (_) / /| | | | (_| | ::' /..\ /..\__/ ' '::: | | | | | | (_) / /| | | | (_| | ::'
vVVv vVVv ': |_| |_| |_|\___/___|_|_|_|\__,_| '' vVVv vVVv ': |_| |_| |_|\___/___|_|_|_|\__,_| ''
installation Firefox-latest - installation Firefox-latest
téléchargement... - téléchargement...
/tmp/getFirefox-21745/firefox-late 100%[======================================>] 58,95M 8,12MB/s in 11s /tmp/getFirefox-9736/firefox-late 100%[======================================>] 58,95M 8,12MB/s in 11s
décompression... - décompression...
- installation...
- récupération du profil default existant <moq4laqz.default>
- alternatives installées pour <latest>
installation...
Firefox-latest installé. Firefox-latest installé.
``` ```
* la dernière officielle Firefox est installée, en étant directement chargée du site Mozilla. * la dernière officielle Firefox est installée, en étant directement chargée du site Mozilla.
* un lanceur par canal Firefox doit se trouver dans les menus (comme Applications/Internet) * un lanceur par canal Firefox doit se trouver dans les menus (comme Applications/Internet)
* l'installation sur un canal existant est refaite en totalité, mais le profil n'est pas modifié * l'installation sur un canal existant est refaite en **totalité**, mais le profil n'est pas modifié
* si un profil _xyz.default_ (d'un paquet _firefox-esr_ par exemple) existe, il sera laissé en place, mais * si un profil _xyz.default_ (d'un paquet _firefox-esr_ par exemple) existe, il sera laissé en place, mais
une **copie** sera utilisée pour le profil latest (ou ESR). le passage d'une version paquet Debian à une une **copie** sera utilisée pour le profil latest (ou ESR). le passage d'une version paquet Debian à une
version Mozilla Release (ou ESR) utilisera donc une copie du profil en cours. version Mozilla Release (ou ESR) utilisera donc une copie du profil en cours. l'éventuel profil default sera
utilisé pour la première installation d'un canal latest ou esr. les réinstallations ultérieures, si les profils
ne sont pas supprimés, n'utiliseront pas de profil défault détecté
* les canaux peuvent coexister * les canaux peuvent coexister
* chaque canal peut être lancé en console: `firefox-latest` `firefox-beta` `firefox-dev` `firefox-nightly` * chaque canal peut être lancé en console: `firefox-latest` `firefox-beta` `firefox-dev` `firefox-nightly`
`firefox-esr` `firefox-esr`
* le plus bas canal installé peut lui être lancé avec: `firefox` * le plus bas canal installé peut lui être lancé avec: `firefox` (_/usr/bin/firefox_)
* si supporté, update-alternatives est configuré pour le plus bas canal installé
4 autres canaux sont possibles: 4 autres canaux sont possibles:
@ -219,20 +227,20 @@ getFirefox u-latest
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.3 - 22/07/2017 pour Debian, version 1.0.0 - 24/07/2017
récupération du profil default existant <moq4laqz.default> - alternatives installées pour <latest>
profil <latest> configuré pour kyodev - profil <latest> configuré pour kyodev
``` ```
* il faut que canal Firefox soit déjà installé * il faut que canal Firefox soit déjà installé
* pour éviter de télécharger inutilement une nouvelle fois pour un nouvel utilisateur: * pour éviter de télécharger inutilement une nouvelle fois pour un nouvel utilisateur:
* changer de session en se connectant sous un nouvel utilisateur * changer de session en se connectant sous un nouvel utilisateur
* utiliser l'option `u-latest` `u-beta` `u-nightly` `u-esr` `u-dev` selon ce qui est installé * utiliser l'option `u-latest` `u-beta` `u-nightly` `u-esr` `u-dev` selon ce qui est installé
* utile pour modifier les **alternatives**, pour configurer en alternatives nightly par exemple: u-nightly * le navigateur Firefox sera disponible dans les menus
* le navigateur Firefox sera disponible dans les menus avec un nouveau profil firefox * un nouveau profil firefox adéquat sera crée si besoin
* update-alternatives restera sur le plus bas canal firefox
sans changer de session, on devrait pouvoir utiliser, pour un utilisateur titi et un canal beta, par exemple: sans changer de session, on devrait pouvoir utiliser, pour un utilisateur titi et un canal beta, par exemple:
```shell ```shell
@ -252,22 +260,21 @@ USER_INSTALL=titi getFirefox u-beta
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.0 - 21/07/2017 pour Debian, version 1.0.0b1 - 24/07/2017
Firefox installé(s): Firefox installé(s):
latest: 54.0.1 latest: 54.0.1
beta: 55.0 beta: 55.0
dev: 55.0
nightly: 56.0a1 nightly: 56.0a1
Version Firefox en ligne: version Firefox en ligne:
Release : 54.0.1 Release : 54.0.1
Beta/dev: 55.0b10 Beta/dev: 55.0b11
Nightly : 56.0a1 Nightly : 56.0a1
ESR : 52.2.1 ESR : 52.2.1
version script en ligne: 0.7.1, mise à jour possible version script en ligne: 1.0.0, mise à jour possible
_.-~-. _.-~-.
7'' Q..\ 7'' Q..\
_7 (_ _7 (_
@ -290,10 +297,10 @@ vVVv vVVv ': |_| |_| |_|\___/___|_|_|_|\__,_| ''
## désinstallation d'un canal Firefox ## désinstallation d'un canal Firefox
`getFirefox r-canal` par exemple, pour la version nightly, en **root**: `getFirefox r-canal` par exemple, pour la version beta, en **root**:
```shell ```shell
getFirefox r-nightly getFirefox r-beta
``` ```
```text ```text
_ _____ _ __ _ _____ _ __
@ -303,7 +310,7 @@ getFirefox r-nightly
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.1 - 21/07/2017 pour Debian, version 1.0.0 - 24/07/2017
_.-~-. _.-~-.
7'' Q..\ 7'' Q..\
@ -319,20 +326,19 @@ getFirefox r-nightly
/..\ /..\__/ ' '::: | | | | | | (_) / /| | | | (_| | ::' /..\ /..\__/ ' '::: | | | | | | (_) / /| | | | (_| | ::'
vVVv vVVv ': |_| |_| |_|\___/___|_|_|_|\__,_| '' vVVv vVVv ': |_| |_| |_|\___/___|_|_|_|\__,_| ''
alternatives installées pour <latest> - alternatives installées pour <latest>
Firefox-nightly désinstallé. Firefox-beta désinstallé.
``` ```
* le profil **n'est pas supprimé**, il sera donc utilisable en cas de réinstallation * le profil **n'est pas supprimé**, il sera donc utilisable en cas de réinstallation
* si firefox est ouvert il sera fermé * si firefox est ouvert il sera fermé
* update-alternatives est configuré sur le plus bas canal installé . * update-alternatives reste configuré sur le plus bas canal installé
pour reconfigurer alternatives sur un autre canal, utiliser `getFirefox u-beta` par exemple
* `firefox` est lui aussi configuré pour le plus bas canal installé * `firefox` est lui aussi configuré pour le plus bas canal installé
## suppression d'un profil firefox ## suppression d'un profil Firefox
en user, lancer en terminal, le profile manager de Firefox: `firefox -P` : en user, lancer en terminal, le profile manager de Firefox: `firefox -P` :
@ -354,14 +360,13 @@ en user, lancer en terminal, le profile manager de Firefox: `firefox -P` :
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.0 - 21/07/2017 pour Debian, version 1.0.0b1 - 24/07/2017
version script en ligne: 0.7.1, mise à jour possible version script en ligne: 1.0.0, mise à jour possible
/tmp/getFirefox-15112/getFirefox 100%[======================================>] 21,06K --.-KB/s in 0,05s /tmp/getFirefox-15112/getFirefox 100%[======================================>] 21,06K --.-KB/s in 0,05s
getFirefox mis à jour en version 0.7.1 getFirefox mis à jour en version 1.0.0
``` ```
@ -398,7 +403,7 @@ en **root**:
\__, |\___|\__|_| |_|_| \___|_| \___/_/\_\ \__, |\___|\__|_| |_|_| \___|_| \___/_/\_\
|___/ |___/
pour Debian, version 0.7.1 - 21/07/2017 pour Debian, version 1.0.0 - 24/07/2017
getFirefox supprimé du système. getFirefox supprimé du système.

View File

@ -1,52 +1,54 @@
#!/bin/bash #!/bin/bash
user_agent="Mozilla/5.0 (X11; Linux $(uname -m); rv:54.0) Gecko/20100101 Firefox/54.0" user_agent="Mozilla/5.0 (X11; Linux $(uname -m); rv:54.0) Gecko/20100101 Firefox/54.0"
# test wget, $1 url à tester, retourne url testée & entêtes file_tempo_test="tempoTest-$RANDOM"
f__testWget(){
echo "$1: $2" # test wget, $1 url à tester, $2 objet, affiche url testée & entêtes http & location
wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$2" &>tempoTest f__wget_entete(){
http="$(cat tempoTest | grep -i 'HTTP/')" wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$1" &>$file_tempo_test
http="$(echo $http | tr '\n' ' - ')" http="$(grep -i 'HTTP/' $file_tempo_test)"
location="$(cat tempoTest | grep -i 'location')" http=" $(echo $http | tr -d '\n')"
echo " $http" location="$(grep -i 'location' $file_tempo_test)"
echo " $location" echo "$2: $1"
echo "$http"
echo "$http" | grep '40' &>/dev/null && echo " ERREUR 404" || echo "$location"
} }
for architecture in linux linux64; do for architecture in linux linux64; do
echo "" echo ""
echo "Architecture: $architecture" echo "Architecture: $architecture"
echo "=====================" echo "====================="
for product in latest esr beta dev nightly; do for product in latest esr beta dev nightly; do
if [ "$product" == "latest" ]; then if [ "$product" == "latest" ]; then
recup_url="https://download.mozilla.org/?product=firefox-$product&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-$product&os=$architecture&lang=fr"
elif [ "$product" == "esr" ]; then elif [ "$product" == "esr" ]; then
recup_url="https://download.mozilla.org/?product=firefox-$product-latest&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-$product-latest&os=$architecture&lang=fr"
elif [ "$product" == "beta" ]; then elif [ "$product" == "beta" ]; then
recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=$architecture&lang=fr"
elif [ "$product" == "dev" ]; then elif [ "$product" == "dev" ]; then
recup_url="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=$architecture&lang=fr"
elif [ "$product" == "nightly" ]; then elif [ "$product" == "nightly" ]; then
recup_url="https://download.mozilla.org/?product=firefox-$product-latest-l10n-ssl&os=$architecture&lang=fr" ;fi recup_url="https://download.mozilla.org/?product=firefox-$product-latest-l10n-ssl&os=$architecture&lang=fr" ;fi
f__wget_entete "$recup_url" "$product"
f__testWget "$product" "$recup_url" done
done done
done
rm tempoTest
fileTmp=sdxfcggbjkl-$RANDOM echo -e "\n===== versions ======"
recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=linux64&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=linux64&lang=fr"
wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$fileTmp" wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$file_tempo_test"
verBeta="$(cat $fileTmp | grep -i 'location' | sed -E 's/.*firefox-(.*)\.tar.bz2/\1/')" verBeta="$(grep -i 'location' $file_tempo_test | sed -E 's/.*firefox-(.*)\.tar.bz2/\1/')"
recup_url="https://download.mozilla.org/?product=firefox-nightly-latest-l10n-ssl&os=linux64&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-nightly-latest-l10n-ssl&os=linux64&lang=fr"
wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$fileTmp" wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$file_tempo_test"
verNightly="$(cat $fileTmp | grep -i 'location' | sed -E 's/.*firefox-(.*)\.fr.linux.*/\1/')" verNightly="$(grep -i 'location' $file_tempo_test | sed -E 's/.*firefox-(.*)\.fr.linux.*/\1/')"
rm "$fileTmp"
echo "Beta/Dev: $verBeta" echo "Beta/Dev: $verBeta"
echo "Nightly : $verNightly" echo "Nightly : $verNightly"
echo "" echo ""
rm $file_tempo_test
exit exit
### liens ### liens

View File

@ -1,7 +1,7 @@
#!/bin/bash #!/bin/bash
version=0.7.6 version=1.0.0
date="22/07/2017" date="24/07/2017"
projet="Kyodev" projet="Kyodev"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues" contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues"
script="getFirefox" script="getFirefox"
@ -36,7 +36,7 @@ cat << 'EOF'
EOF EOF
echo -e "$YELLOW pour Debian, version $version - $date$COLOR\n" echo -e "$YELLOW pour Debian, version $version - $date$COLOR\n"
# detect system architecture, assign $architecture : linux | linux64, return 1 on unknown architecture # détection architecture, assign $architecture : linux|linux64, return 1 si architecture inconnue
f__architecture(){ f__architecture(){
case "$(uname -m)" in case "$(uname -m)" in
amd64 | x86_64 ) amd64 | x86_64 )
@ -75,9 +75,9 @@ f__user(){
fi fi
} }
#test dépendances (commandes disponibles), $1 liste commandes # test dépendances (commandes disponibles), $1 liste commandes ou $1...$x, si manquant, sortie avec erreur
f__requis(){ f__requis(){
for i in "$@"; do for i in $@; do
if [ ! "$(which $i)" ]; then if [ ! "$(which $i)" ]; then
testDepends="ko" testDepends="ko"
f__info "$RED vous devez avoir la commande $i pour exploiter ce script" f__info "$RED vous devez avoir la commande $i pour exploiter ce script"
@ -86,20 +86,20 @@ f__requis(){
[ -z "$testDepends" ] || f__error "Paquets manquants" " Contacter administrateur pour disposer de ces commandes" [ -z "$testDepends" ] || f__error "Paquets manquants" " Contacter administrateur pour disposer de ces commandes"
} }
# test wget, $1 url à tester, retourne url testée & entêtes # test wget, $1 url à tester, sortie sur erreur
f__testWget(){ f__wget_test(){
echo " $1" echo " $1"
wget -Sq --tries=1 --timeout=15 --user-agent="$user_agent" -O /dev/null "$1" wget -Sq --tries=1 --timeout=15 --user-agent="$user_agent" -O /dev/null "$1"
f__error "Erreur wget" " réessayer et si persistance, contacter $projet $contact" " en indiquant les messages précédents." f__error "Erreur wget" " réessayer et si persistance, contacter $projet $contact" " en indiquant les messages précédents."
} }
# test validité archive, $1 fichier (bzip2), assigne $archive_detect, return 1 si invalide # test validité archive, $1 fichier (bzip2), return 1 si invalide
f__testArchive(){ f__archive_test(){
file -b "$1" | grep 'bzip2 compressed data' &>/dev/null && archive_detect="bzip2" || return 1 file -b "$1" | grep 'bzip2 compressed data' &>/dev/null || return 1
} }
# sortie sur erreur, log $1 si upgrade # affichage $1 en rouge, $1++ optionnels en bleu, sortie script sur erreur, log $1 si upgrade($opType)
f__error() { #affichage $1 en rouge, $1++ optionnels en bleu, sortie du script, log $1 si upgrade f__error() {
echo -e "\n$RED Erreur critique: $1 $COLOR" echo -e "\n$RED Erreur critique: $1 $COLOR"
for (( i=2 ; i<=$# ; i++ )); do echo -e " $BLUE${!i}"; done for (( i=2 ; i<=$# ; i++ )); do echo -e " $BLUE${!i}"; done
echo "$COLOR" echo "$COLOR"
@ -107,16 +107,16 @@ f__error() { #affichage $1 en rouge, $1++ optionnels en bleu, sortie du script,
exit 1 exit 1
} }
# affichage information, log $1 si upgrade # affichage des paramètres en bleu, ligne vide à la fin, syslog $1 si upgrade
f__info() { # tous les paramètres en ligne en couleur bleue, accepte \n, ligne vide à la fin f__info() {
for (( i=1 ; i<=$# ; i++ )); do echo -e " $BLUE${!i}"; done for (( i=1 ; i<=$# ; i++ )); do echo -e " $BLUE${!i}"; done
echo "$COLOR" echo "$COLOR"
if [ "$opType" == "upgrade" ]; then logger --id -p user.info "$1"; fi if [ "$opType" == "upgrade" ]; then logger --id -p user.info "$1"; fi
} }
# root? return 0 else 1 # root? return 0 else 1
f__root(){ f__root(){
if [ $EUID -eq 0 ]; then return 0; else return 1; fi [ $EUID -eq "0" ] && return 0 || return 1
} }
# install du script dans le système # install du script dans le système
@ -157,22 +157,22 @@ fscript_remove(){
f__info "$GREEN$script supprimé du système." f__info "$GREEN$script supprimé du système."
} }
# version script en ligne, assigne $versionScript, $uptd_script=""|ko, # version script en ligne, assigne $script_aJour=ok|ko,
fscript_version(){ fscript_version(){
versionScript="$(wget -q --tries=2 --timeout=15 --user-agent="$user_agent" -O - "$urlScript" | grep '^version=' | cut -d '=' -f 2)" versionScript="$(wget -q --tries=2 --timeout=15 --user-agent="$user_agent" -O - "$urlScript" | grep '^version=' | cut -d '=' -f 2)"
if [ "$version" != "$versionScript" ]; then if [ "$version" != "$versionScript" ]; then
f__info "version script en ligne: $versionScript, mise à jour possible" f__info "version script en ligne: $versionScript, mise à jour possible"
uptd_script="ko" script_aJour="ko"
else uptd_script=""; fi else script_aJour="ok"; fi
} }
# mise à jour script si dispo # mise à jour script si dispo
fscript_dl(){ fscript_dl(){
if [ "$uptd_script" != "ko" ]; then return 0; fi if [ "$script_aJour" == "ok" ]; then return 0; fi
dirTemp="/tmp/$script-$RANDOM/" dirTemp="/tmp/$script-$RANDOM/"
mkdir -p "$dirTemp" mkdir -p "$dirTemp"
wget -q --show-progress --tries=2 --timeout=15 --user-agent="$user_agent" -O "$dirTemp$script" "$urlScript" wget -q --show-progress --tries=2 --timeout=15 --user-agent="$user_agent" -O "$dirTemp$script" "$urlScript"
if [ "$?" != "0" ]; then f__testWget "$urlScript"; fi if [ "$?" != "0" ]; then f__wget_test "$urlScript"; fi
chmod a+rwx "$dirTemp$script" chmod a+rwx "$dirTemp$script"
chown "$user_": "$dirTemp$script" chown "$user_": "$dirTemp$script"
cp -d "$dirTemp$script" /opt/bin/"$script" cp -d "$dirTemp$script" /opt/bin/"$script"
@ -181,10 +181,10 @@ fscript_dl(){
exit 0 exit 0
} }
#inscription dans tache upgrade en cron hebdomadaire, une partie requiert root # inscription dans tache upgrade en anacron hebdomadaire, via cron horaire
fscript_cronAnacron(){ fscript_cronAnacron(){
case "$1" in case "$1" in
"install" ) install )
# table anacron # table anacron
echo "7 05 getFF nice /opt/bin/$script upgrade &>/dev/null" > "/home/$user_/.mozilla/$script.anacrontab" echo "7 05 getFF nice /opt/bin/$script upgrade &>/dev/null" > "/home/$user_/.mozilla/$script.anacrontab"
## test: anacron journalier: ## test: anacron journalier:
@ -196,7 +196,7 @@ chown "$user_": "/home/$user_/.config/anacron/spool"
# cron tab pour activation horaire anacron # cron tab pour activation horaire anacron
echo "@hourly $user_ /usr/sbin/anacron -t /home/$user_/.mozilla/$script.anacrontab -S /home/$user_/.config/anacron/spool" >> /etc/crontab echo "@hourly $user_ /usr/sbin/anacron -t /home/$user_/.mozilla/$script.anacrontab -S /home/$user_/.config/anacron/spool" >> /etc/crontab
;; ;;
"remove" ) remove )
[ -e "/home/$user_/.config/anacron/spool/getFF" ] && rm "/home/$user_/.config/anacron/spool/getFF" [ -e "/home/$user_/.config/anacron/spool/getFF" ] && rm "/home/$user_/.config/anacron/spool/getFF"
sed -i "/^\@hourly.*$script.anacrontab.*$/d" /etc/crontab sed -i "/^\@hourly.*$script.anacrontab.*$/d" /etc/crontab
rm "/home/$user_/.mozilla/$script.anacrontab" rm "/home/$user_/.mozilla/$script.anacrontab"
@ -204,7 +204,7 @@ rm "/home/$user_/.mozilla/$script.anacrontab"
esac esac
} }
# ascii art godzilla # ascii art godzilla; ligne vide finale
ffx_godzilla(){ ffx_godzilla(){
printf "$RED" printf "$RED"
cat << 'EOF' cat << 'EOF'
@ -259,19 +259,18 @@ EOF
echo -e "plus d'infos:$GREEN https://framagit.org/kyodev/kyopages/raw/master/scripts/getFirefox$COLOR\n" echo -e "plus d'infos:$GREEN https://framagit.org/kyodev/kyopages/raw/master/scripts/getFirefox$COLOR\n"
} }
# version Firefox en ligne, $verLatest, $verEsr, $versionInstall, $urlOnline, si $1="quiet", pas d'affichage version en ligne # version Firefox en ligne
ffx_versionFF(){ ffx_versionsFF(){
urlOnline="https://www.mozilla.org/en-US/firefox/notes/" stockageUrlOnline="$(wget -q --tries=2 --timeout=15 --user-agent=$user_agent -O - https://www.mozilla.org/en-US/firefox/notes/)"
stockUrlOnline="$(wget -q --tries=2 --timeout=15 --user-agent=$user_agent -O - $urlOnline)" verLatest="$(echo $stockageUrlOnline | grep -Eo 'data-latest-firefox="[0-9\.]+"' | grep -Eo '[0-9\.]+')"
verLatest="$(echo $stockUrlOnline | grep -Eo 'data-latest-firefox="[0-9\.]+"' | grep -Eo '[0-9\.]+')" verEsr="$(echo $stockageUrlOnline | grep -Eo 'data-esr-versions="[0-9\.]+"' | grep -Eo '[0-9\.]+')"
verEsr="$(echo $stockUrlOnline | grep -Eo 'data-esr-versions="[0-9\.]+"' | grep -Eo '[0-9\.]+')" fileTmp="sdxfcggbjkl-$RANDOM"
fileTmp=sdxfcggbjkl-$RANDOM
recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=linux64&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=linux64&lang=fr"
wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$fileTmp" wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$fileTmp"
verBeta="$(cat $fileTmp | grep -i 'location' | sed -E 's/.*firefox-(.*)\.tar.bz2/\1/')" verBeta="$(grep -i 'location' $fileTmp | sed -E 's/.*firefox-(.*)\.tar.bz2/\1/')"
recup_url="https://download.mozilla.org/?product=firefox-nightly-latest-l10n-ssl&os=linux64&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-nightly-latest-l10n-ssl&os=linux64&lang=fr"
wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$fileTmp" wget -Sq --tries=1 --timeout=10 --user-agent="$user_agent" --spider --save-headers "$recup_url" &>"$fileTmp"
verNightly="$(cat $fileTmp | grep -i 'location' | sed -E 's/.*firefox-(.*)\.fr.linux.*/\1/')" verNightly="$(grep -i 'location' $fileTmp | sed -E 's/.*firefox-(.*)\.fr.linux.*/\1/')"
rm "$fileTmp" rm "$fileTmp"
for product in latest esr beta dev nightly; do for product in latest esr beta dev nightly; do
if [ -x "$dirInstall$product/firefox" ]; then if [ -x "$dirInstall$product/firefox" ]; then
@ -279,118 +278,111 @@ ffx_versionFF(){
fi fi
done done
f__info "Firefox installé(s): $versionInstall" f__info "Firefox installé(s): $versionInstall"
f__info "Version Firefox en ligne:\n Release : $verLatest\n Beta/dev: $verBeta\n Nightly : $verNightly\n ESR : $verEsr" f__info "version Firefox en ligne:\n Release : $verLatest\n Beta/dev: $verBeta\n Nightly : $verNightly\n ESR : $verEsr"
} }
# création lanceur.desktop # création lanceur.desktop
ffx_lanceur_desktop(){ ffx_lanceur_desktop(){
fileDesktopEnCeation="/usr/share/applications/firefox-$product.desktop" fileDesktop="/usr/share/applications/firefox-$product.desktop"
echo "#!/usr/bin/env xdg-open" > "$fileDesktopEnCeation" echo "#!/usr/bin/env xdg-open" > "$fileDesktop"
echo "[Desktop Entry]" >> "$fileDesktopEnCeation" echo "[Desktop Entry]" >> "$fileDesktop"
echo "Name=Firefox $product" >> "$fileDesktopEnCeation" echo "Name=Firefox $product" >> "$fileDesktop"
echo "Name[fr]=Firefox $product" >> "$fileDesktopEnCeation" echo "Name[fr]=Firefox $product" >> "$fileDesktop"
echo "X-GNOME-FullName=Firefox-$product Web Browser" >> "$fileDesktopEnCeation" echo "X-GNOME-FullName=Firefox-$product Web Browser" >> "$fileDesktop"
echo "X-GNOME-FullName[fr]=Firefox-$product Navigateur Web" >> "$fileDesktopEnCeation" echo "X-GNOME-FullName[fr]=Firefox-$product Navigateur Web" >> "$fileDesktop"
echo "StartupWMClass=Firefox-$product" >> "$fileDesktopEnCeation" echo "StartupWMClass=Firefox-$product" >> "$fileDesktop"
echo "Exec=/usr/bin/firefox-$product %u" >> "$fileDesktopEnCeation" echo "Exec=/usr/bin/firefox-$product %u" >> "$fileDesktop"
echo "Icon=$dirInstall$product/browser/icons/mozicon128.png" >> "$fileDesktopEnCeation" echo "Icon=$dirInstall$product/browser/icons/mozicon128.png" >> "$fileDesktop"
echo "Comment=Browse the World Wide Web" >> "$fileDesktopEnCeation" echo "Comment=Browse the World Wide Web" >> "$fileDesktop"
echo "Comment[fr]=Naviguer sur Internet" >> "$fileDesktopEnCeation" echo "Comment[fr]=Naviguer sur Internet" >> "$fileDesktop"
echo "GenericName=Web Browser" >> "$fileDesktopEnCeation" echo "GenericName=Web Browser" >> "$fileDesktop"
echo "GenericName[fr]=Navigateur Web" >> "$fileDesktopEnCeation" echo "GenericName[fr]=Navigateur Web" >> "$fileDesktop"
echo "Terminal=false" >> "$fileDesktopEnCeation" echo "Terminal=false" >> "$fileDesktop"
echo "X-MultipleArgs=false" >> "$fileDesktopEnCeation" echo "X-MultipleArgs=false" >> "$fileDesktop"
echo "Type=Application" >> "$fileDesktopEnCeation" echo "Type=Application" >> "$fileDesktop"
echo "Categories=Network;WebBrowser;" >> "$fileDesktopEnCeation" echo "Categories=Network;WebBrowser;" >> "$fileDesktop"
echo "MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;" >> "$fileDesktopEnCeation" echo "MimeType=text/html;text/xml;application/xhtml+xml;application/xml;application/vnd.mozilla.xul+xml;application/rss+xml;application/rdf+xml;image/gif;image/jpeg;image/png;x-scheme-handler/http;x-scheme-handler/https;" >> "$fileDesktop"
echo "StartupNotify=true" >> "$fileDesktopEnCeation" echo "StartupNotify=true" >> "$fileDesktop"
} }
# traitement de profile.ini, inscription si utile (pas déjà existante) # traitement de profile.ini, inscription si pas déjà existante
ffx_profilIni(){ ffx_profilIni_inscription(){
#si déjà profil existant dans profil.ini, sortir # si déjà profil existant dans profil.ini, sortir
if [ "$(grep -rc Name=$product $fileProfileIni)" != 0 ]; then return; fi if [ "$(grep -c Name=$product $fileProfileIni)" != 0 ]; then return; fi
#comptage profils existants # comptage profils existants
nbProfiles="$(grep -rEc '\[Profile[0-9]+\]' $fileProfileIni)" nbProfiles="$(grep -Ec '\[Profile[0-9]+\]' $fileProfileIni)"
#création profil dans profile.ini # création profil dans profile.ini
echo "" >> "$fileProfileIni" echo "" >> "$fileProfileIni"
echo "[Profile$nbProfiles]" >> "$fileProfileIni" echo "[Profile$nbProfiles]" >> "$fileProfileIni"
echo "Name=$product" >> "$fileProfileIni" echo "Name=$product" >> "$fileProfileIni"
echo "IsRelative=1" >> "$fileProfileIni" echo "IsRelative=1" >> "$fileProfileIni"
echo "Path=$product" >> "$fileProfileIni" echo "Path=$product" >> "$fileProfileIni"
#si existant et latest, supprimer Default=1 et attribuer à latest, dans profile.ini # si existant et latest (ou esr), supprimer Default=1 et attribuer à latest, dans profile.ini
if [ "$product" == "latest" ] || [ "$product" == "esr" ]; then if [ "$product" == "latest" ] || [ "$product" == "esr" ]; then
sed -i 's/Default=1//' "$fileProfileIni" sed -i 's/Default=1//' "$fileProfileIni"
echo "Default=1" >> "$fileProfileIni" echo "Default=1" >> "$fileProfileIni"
else echo "" >> "$fileProfileIni"; fi else echo "" >> "$fileProfileIni"; fi
} }
# traitement update-alternatives, $1 install|remove, # détermination canal bas Firefox installé, assigne $firefoxCanalBas
ffx_upt_altern(){ ffx_canal_bas(){
which update-alternatives &>/dev/null || return 0
# suppression alternatives x-www-browser si existantes
if update-alternatives --get-selections | grep firefox | grep x-www-browser &>/dev/null; then
update-alternatives --quiet --remove-all x-www-browser
fi
if [ "$1" == "install" ]; then
update-alternatives --quiet --install /usr/bin/firefox x-www-browser "/usr/bin/firefox-$product" 100
elif [ "$1" == "remove" ]; then
for i in nightly dev beta esr latest; do
if [ -d "$dirInstall$i/" ]; then firefoxBas="$i"; fi
done
update-alternatives --quiet --install /usr/bin/firefox x-www-browser "/usr/bin/firefox-$firefoxBas" 100
f__info "alternatives installées pour <$firefoxBas>"
fi
}
# lien /usr/bin/firefox pour la plus basse version firefox installée
ffx_usr_bin(){
for i in nightly dev beta esr latest; do for i in nightly dev beta esr latest; do
if [ -d "$dirInstall$i/" ]; then firefoxBas="$i"; fi if [ -d "$dirInstall$i/" ]; then firefoxCanalBas="$i"; fi
done done
ln -sf "/usr/bin/firefox-$firefoxBas" "/usr/bin/firefox" }
# traitement update-alternatives
ffx_update_alternatives(){
which update-alternatives &>/dev/null || return 0 # update-laternatives n'est pas sur cette distrib
ffx_canal_bas
update-alternatives --quiet --install /usr/bin/firefox x-www-browser "/usr/bin/firefox-$firefoxCanalBas" 100
f__info " - alternatives installées pour <$firefoxCanalBas>"
}
# lien /usr/bin/firefox pour le plus bas canal Firefox installé, utile si update-alternatives pas fonctionnel
ffx_usr_bin(){
ffx_canal_bas
ln -sf "/usr/bin/firefox-$firefoxCanalBas" "/usr/bin/firefox"
} }
# traitement utilisateur, $1 user, si appel indépendant pour reconfiguration # traitement utilisateur, $1 user, si appel indépendant pour reconfiguration
ffx_profilUser(){ ffx_profil_User(){
if [ "$1" == "user" ] && [ ! -x "/usr/bin/firefox-$product" ]; then if [ "$1" == "user" ] && [ ! -x "/usr/bin/firefox-$product" ]; then
f__error "firefox <$product> n'est pas installé" " il faut donc utiliser l'installation et pas l'ajout d'un nouveau profil" f__error "firefox <$product> n'est pas installé" " il faut donc utiliser l'installation et pas l'ajout d'un nouveau profil"
fi fi
dirProfil="/home/$user_/.mozilla/firefox" # si profile.ini existe on traite default sinon on le crée avec minimum d'entête (première installation Firefox)
fileProfileIni="$dirProfil/profiles.ini"
# si profile.ini existe on traite default sinon on le crée avec minimum d'entête
if [ -w "$fileProfileIni" ]; then if [ -w "$fileProfileIni" ]; then
# recherche éventuel profil tuvwxyz.default dans profile.ini # recherche éventuel profil tuvwxyz.default dans profile.ini
profileDefault="$(grep -r '\.default' $fileProfileIni | sed 's/Path=//')" profileDefault="$(grep '\.default' $fileProfileIni | sed 's/Path=//')"
# si profileDefault existant, on l'utilise pour latest (ou esr) si pas déjà présent # si profileDefault existant, on l'utilise pour latest (ou esr) si pas déjà présent
if [ "$profileDefault" ] && [ -d "$dirProfil/$profileDefault" ] && [ "$product" == "latest" ] || [ "$product" == "esr" ]; then if [ "$profileDefault" ] && [ -d "$dirProfil/$profileDefault" ] && [ "$product" == "latest" ] || [ "$product" == "esr" ]; then
if [ ! -d "$dirProfil/$product" ]; then if [ ! -d "$dirProfil/$product" ]; then # le profil cible n'existe pas
f__info " - récupération du profil default existant <$profileDefault>"
mkdir -p "$dirProfil/$product" mkdir -p "$dirProfil/$product"
f__info "récupération du profil default existant <$profileDefault>"
cp -R "$dirProfil/$profileDefault"/* "$dirProfil/$product/" cp -R "$dirProfil/$profileDefault"/* "$dirProfil/$product/"
fi fi
fi fi
else else
echo -e "[General]\nStartWithLastProfile=1\n\n" >> "$fileProfileIni" echo -e "[General]\nStartWithLastProfile=1\n\n" >> "$fileProfileIni"
chown "$user_": "$fileProfileIni" chown "$user_": "$fileProfileIni" # propriété du fichier profile.ini à l'user
chmod u+rw,go+r "$fileProfileIni" chmod u+rw,go+r "$fileProfileIni" # permissions du fichier profile.ini à l'user
fi fi
mkdir -p "$dirProfil/$product" mkdir -p "$dirProfil/$product"
chown -R "$user_": "$dirProfil/$product/" # propriété du répertoire profile à l'user chown -R "$user_": "$dirProfil/$product/" # propriété du répertoire profile à l'user
chmod g-rx,o-rx "$dirProfil/$product/" # droits répertoire comme firefox officiel chmod g-rx,o-rx "$dirProfil/$product/" # droits répertoire comme Firefox officiel
ffx_profilIni ffx_profilIni_inscription
ffx_lanceur_desktop ffx_lanceur_desktop
ffx_upt_altern "install" ffx_update_alternatives
if [ "$1" == "user" ]; then f__info "profil <$product> configuré pour $user_"; fi if [ "$1" == "user" ]; then f__info " - profil <$product> configuré pour $user_"; fi
} }
# calcul url téléchargement, assigne $recup_url # calcul url téléchargement, assigne $recup_url. fixer url pour beta et nightly dans ffx_versionsFF
ffx_recup_url(){ ffx_recup_url(){
if [ "$product" == "latest" ]; then if [ "$product" == "latest" ]; then
recup_url="https://download.mozilla.org/?product=firefox-$product&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-$product&os=$architecture&lang=fr"
elif [ "$product" == "esr" ]; then elif [ "$product" == "esr" ]; then
recup_url="https://download.mozilla.org/?product=firefox-$product-latest&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-$product-latest&os=$architecture&lang=fr"
elif [ "$product" == "beta" ]; then elif [ "$product" == "beta" ]; then
recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-beta-latest&os=$architecture&lang=fr"
elif [ "$product" == "dev" ]; then elif [ "$product" == "dev" ]; then
recup_url="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=$architecture&lang=fr" recup_url="https://download.mozilla.org/?product=firefox-devedition-latest-ssl&os=$architecture&lang=fr"
@ -398,27 +390,26 @@ ffx_recup_url(){
recup_url="https://download.mozilla.org/?product=firefox-$product-latest-l10n-ssl&os=$architecture&lang=fr" ;fi recup_url="https://download.mozilla.org/?product=firefox-$product-latest-l10n-ssl&os=$architecture&lang=fr" ;fi
} }
# install firefox # installation Firefox
ffx_install(){ ffx_install(){
f__root || f__error "vous devez être ROOT pour installer Firefox" f__root || f__error "vous devez être ROOT pour installer Firefox"
ffx_godzilla ffx_godzilla
f__info "installation Firefox-$product" f__info " - installation Firefox-$product"
# dossier temporaire de travail, création $dirTemp # dossier temporaire de travail
dirTemp="/tmp/$script-$RANDOM/" dirTemp="/tmp/$script-$RANDOM/"
mkdir -p "$dirTemp" mkdir -p "$dirTemp"
# téléchargement, test archive # téléchargement & test archive
f__info "téléchargement..." f__info " - téléchargement..."
file="firefox-$product.$architecture.tar.bz2" file="firefox-$product.$architecture.tar.bz2"
ffx_recup_url ffx_recup_url
wget -q -c --show-progress --tries=2 --timeout=15 --user-agent="$user_agent" -O "$dirTemp$file" "$recup_url" wget -q -c --show-progress --tries=2 --timeout=15 --user-agent="$user_agent" -O "$dirTemp$file" "$recup_url"
if [ "$?" != "0" ]; then f__testWget "$recup_url"; fi if [ "$?" != "0" ]; then f__wget_test "$recup_url"; fi
f__testArchive "$dirTemp$file" || f__error "Le fichier $dirTemp$file n'est pas une archive tar.gz valide" f__archive_test "$dirTemp$file" || f__error "Le fichier $dirTemp$file n'est pas une archive tar.gz valide"
# décompression # décompression
f__info "\n décompression..." f__info "\n - décompression..."
tar -xaf "$dirTemp$file" -C "$dirTemp" tar -xaf "$dirTemp$file" -C "$dirTemp"
# mise en place finale
f__info "installation..." f__info " - installation..."
# on déplace le répertoire firefox dans le répertoire installation
rm -rf "$dirInstall$product"/ # effacement éventuel répertoire existant: "vraie" install rm -rf "$dirInstall$product"/ # effacement éventuel répertoire existant: "vraie" install
mkdir -p "$dirInstall$product"/ mkdir -p "$dirInstall$product"/
mv -f "$dirTemp"firefox/* "$dirInstall$product"/ mv -f "$dirTemp"firefox/* "$dirInstall$product"/
@ -426,53 +417,56 @@ ffx_install(){
chmod -R g+wrs,a+r "$dirInstall$product"/ chmod -R g+wrs,a+r "$dirInstall$product"/
rm -rf "$dirTemp" rm -rf "$dirTemp"
# lien icône Firefox # lien icône Firefox
ln -sf "$dirInstall$product"/browser/chrome/icons/default/default48.png /usr/share/pixmaps/firefox-"$product".png ln -sf "$dirInstall$product/browser/chrome/icons/default/default48.png" "/usr/share/pixmaps/firefox-$product.png"
# lanceur dans /usr/bin # lanceur dans /usr/bin
echo "#!/bin/sh" > /usr/bin/firefox-"$product" echo "#!/bin/sh" > "/usr/bin/firefox-$product"
echo "exec $dirInstall$product/firefox -P $product" "\$@" >> /usr/bin/firefox-"$product" echo "exec $dirInstall$product/firefox -P $product" "\$@" >> "/usr/bin/firefox-$product"
chmod a+x /usr/bin/firefox-"$product" chmod a+x "/usr/bin/firefox-$product"
ffx_usr_bin ffx_usr_bin
# traitement user # traitement user
ffx_profilUser ffx_profil_User
f__info "$GREEN""Firefox-$product installé." f__info "$GREEN""Firefox-$product installé."
} }
# désinstallation de firefox # désinstallation de Firefox
ffx_remove(){ ffx_remove(){
f__root || f__error "vous devez être ROOT pour désinstaller" f__root || f__error "vous devez être ROOT pour désinstaller"
ffx_godzilla ffx_godzilla
killall "/opt/usr/share/firefox-$product/firefox" &>/dev/null killall "/opt/usr/share/firefox-$product/firefox" &>/dev/null
# si pas de lanceur desktop, on considère que ce canal firefox n'est pas installé, retour # si pas de lanceur desktop, on considère que ce canal Firefox n'est pas installé, retour
if [ ! -e "/usr/share/applications/firefox-$product.desktop" ]; then if [ ! -e "/usr/share/applications/firefox-$product.desktop" ]; then # si test répertoire, on détecterait pas l'ancien répertoire éventuel
f__info "$GREEN" "Firefox-$product n'est pas installé." f__info "$GREEN""Firefox-$product n'est pas installé."
return 1 return 0
fi fi
# suppression du répertoire firefox # suppression du répertoire Firefox
if [ -d "/opt/firefox-$product/" ]; then rm -rf "/opt/firefox-$product/"; fi # ancien répertoire éventuel if [ -d "/opt/firefox-$product/" ]; then rm -rf "/opt/firefox-$product/"; fi # ancien répertoire éventuel
if [ -d "$dirInstall$product/" ]; then rm -rf "$dirInstall$product/"; fi if [ -d "$dirInstall$product/" ]; then rm -rf "$dirInstall$product/"; fi
# suppression lanceurs # suppression lanceurs
rm -f /usr/share/applications/firefox-"$product".desktop rm -f "/usr/share/applications/firefox-$product.desktop"
rm -f /usr/bin/firefox-"$product" rm -f "/usr/bin/firefox-$product"
# suppression des liens # suppression des liens
unlink "/usr/share/pixmaps/firefox-$product.png" &>/dev/null unlink "/usr/share/pixmaps/firefox-$product.png" &>/dev/null
unlink "/usr/bin/firefox-$product" &>/dev/null unlink "/usr/bin/firefox-$product" &>/dev/null
# recréation lanceur Firefox & update-alternatives
ffx_usr_bin ffx_usr_bin
ffx_upt_altern "remove" ffx_update_alternatives
f__info "$GREEN""Firefox-$product désinstallé." f__info "$GREEN""Firefox-$product désinstallé."
} }
#initialisation # initialisation
f__architecture || f__error "Architecture non supportée" f__architecture || f__error "Architecture non supportée"
f__user f__user
f__requis "wget" "logger" "file" "tar" f__requis "wget logger file tar logger"
dirInstall="/opt/usr/share/firefox-" dirInstall="/opt/usr/share/firefox-"
dirProfil="/home/$user_/.mozilla/firefox"
fileProfileIni="$dirProfil/profiles.ini"
# installation du script si pas dans le système # installation du script si appel pas fait depuis le système
dirname "$0" | grep 'bin' &>/dev/null || fscript_install dirname "$0" | grep 'bin' &>/dev/null || fscript_install
# détection droits inappropriés sur le script # détection droits inappropriés sur le script
[ "$1" != "sysremove" ] && [ -e "/opt/bin/$script" ] && ls -l "/opt/bin/$script" | grep 'root' &>/dev/null && f__error "bug sécu 01" \ [ "$1" != "sysremove" ] && [ -e "/opt/bin/$script" ] && ls -l "/opt/bin/$script" | grep 'root' &>/dev/null && f__error "bug sécu 01" \
"veuillez désinstaller le script et le réinstaller" "voir: $urlNotice#messages-avertissement" "veuillez désinstaller le script et le réinstaller" "voir: $urlNotice#messages-avertissement"
#détection ancien repertoire install # détection ancien répertoire installation
ls -ld /opt/firefox-* &>/dev/null && f__info "$RED""Ancien répertoire d'installation détecté" \ ls -ld /opt/firefox-* &>/dev/null && f__info "$RED""Ancien répertoire d'installation détecté" \
"Il faudrait désinstaller et réinstaller pour être à jour" "version(s) détectée(s):" \ "Il faudrait désinstaller et réinstaller pour être à jour" "version(s) détectée(s):" \
"$(ls -ld /opt/firefox-* | sed -E 's/.*firefox-(.*)/ \1/')" "$(ls -ld /opt/firefox-* | sed -E 's/.*firefox-(.*)/ \1/')"
@ -481,9 +475,9 @@ case "$1" in
sysremove ) sysremove )
fscript_remove ;; # désinstallation du script fscript_remove ;; # désinstallation du script
version | -v | --version | -version ) version | -v | --version | -version )
ffx_versionFF ffx_versionsFF
fscript_version fscript_version
ffx_godzilla ;; # affiche versions FF en ligne & installée & version script ffx_godzilla ;; # affiche versions Firefox en ligne & installées & version script
upgrade ) upgrade )
opType="upgrade" opType="upgrade"
fscript_version fscript_version
@ -491,14 +485,14 @@ case "$1" in
i-latest | i-esr | i-dev | i-beta | i-nightly | \ i-latest | i-esr | i-dev | i-beta | i-nightly | \
+latest | +esr | +dev | +beta | +nightly ) +latest | +esr | +dev | +beta | +nightly )
product="$(echo $1 | sed 's/i-//' | sed 's/+//')" product="$(echo $1 | sed 's/i-//' | sed 's/+//')"
ffx_install ;; # installation plugin ffx_install ;; # install: installation canal Firefox
r-latest | r-esr | r-dev | r-beta | r-nightly | \ r-latest | r-esr | r-dev | r-beta | r-nightly | \
-latest | -esr | -dev | -beta | -nightly ) -latest | -esr | -dev | -beta | -nightly )
product="$(echo $1 | sed 's/r-//' | sed 's/-//' )" product="$(echo $1 | sed 's/r-//' | sed 's/-//' )"
ffx_remove ;; # désinstallation plugin ffx_remove ;; # remove: désinstallation Firefox
u-latest | u-esr | u-dev | u-beta | u-nightly ) u-latest | u-esr | u-dev | u-beta | u-nightly )
product="$(echo $1 | sed 's/u-//')" product="$(echo $1 | sed 's/u-//')"
ffx_profilUser "user" ;; # installation profil pour utilisateur en cours ffx_profil_User "user" ;; # user: profil pour utilisateur en cours ou reconfiguration
* ) * )
ffx_help ;; # affichage help par défaut ffx_help ;; # affichage help par défaut
esac esac

View File

@ -1,5 +1,15 @@
# changelog getFirefox # changelog getFirefox
## todo
* install: utilisation copie du plus bas profil existant?
## 1.0.0 24/07/2017
* relecture
* update-alternatives: firefoxCanalBas pour install/remove
## 0.7.6 22/07/2017 ## 0.7.6 22/07/2017
* pas d'update-alternatives si hors debian * pas d'update-alternatives si hors debian