This commit is contained in:
kyodev 2017-09-03 10:36:28 +02:00
parent 307741309e
commit 81a76dd88d
2 changed files with 16 additions and 11 deletions

View File

@ -1,7 +1,7 @@
#!/bin/bash
version=3.1.0b
date="02/09/2017"
version=3.2.0
date="03/09/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
script="getFirefox"
@ -612,7 +612,7 @@ ffx_pers_get_version(){ # v02/09/2017
}
# recup user.js et chrome/userChrome.css, $1=canal à personnaliser ou mettre à jour
ffx_pers_install(){ # v02/09/2017
ffx_pers_install(){ # v03/09/2017
local canal="$1" urlPers verPersDL dirTemp
if [ ! -d "$dirProfil/$canal" ]; then
f__info "firefox $canal inexistant"
@ -631,15 +631,16 @@ ffx_pers_install(){ # v02/09/2017
if [ "$?" != "0" ]; then f__wget_test "$urlPers"user.js; fi
verPersDL="$(sed -En 's/\/\*v(.*)\*\//\1/p' "$dirTemp"user.js)" # uniquement sur user.js
wget -q --tries=1 --timeout=15 -O "$dirTemp"userChrome.css "$urlPers"userChrome.css
chown -R "$user_": "$dirTemp"
# installation
mkdir -p "$dirProfil/$canal/chrome/" # répertoire pour userChrome.css
chown "$user_": "$dirProfil/$canal/chrome"
cp "$dirTemp"user.js "$dirProfil/$canal/"
chown "$user_": "$dirProfil/$canal/user.js"
[ -e "$dirTemp"userChrome.css ] && cp "$dirTemp"userChrome.css "$dirProfil/$canal/chrome"
chown "$user_": "$dirProfil/$canal/chrome/userChrome.css"
echo "$urlPers" > "$dirProfil/$canal/personnalisation.$script"
echo "$verPersDL" >> "$dirProfil/$canal/personnalisation.$script"
chown -R "$user_": "$dirProfil/$canal/personnalisation.$script"
chown "$user_": "$dirProfil/$canal/personnalisation.$script"
rm -rf "$dirTemp"
f__info "log" "personnalisation $verPersDL mise en place pour $canal"
}
@ -936,10 +937,10 @@ ls -d /opt/firefox-* &>/dev/null && problemOldInstall="detected" # ancienne loc
[ -e "/opt/bin/$script" ] && [ "$(stat -c %G /opt/bin/$script)" == "root" ] && problemDetected+="-1" # droits inappropriés sur le script, version de dev
grep -Eq '^exec.*/firefox -P.*$' '/usr/bin/firefox' && problemDetected+="-3" # raccourci /usr/bin en erreur
options=$@
if [ "$(dirname $0)" == "." ]; then options="-i" # script install
else
#if [ "$(dirname $0)" == "." ]; then options="-i" # script install
#else
if [ ! -w "$fileLogs" ] && ls -d "$dirInstall"* &>/dev/null ; then problemDetected+="-2"; fi # ancien système de logs via syslog
fi
#fi
[ "$problemDetected" ] && f__info "$RED""l'installation du script est obsolète ($problemDetected)" \
"veuillez réinstaller le script manuellement" "$GREEN""voir $urlNotice""#installation-rapide-du-script"
@ -1001,14 +1002,14 @@ for i in $options; do
f_tb_remove
exit ;; # désinstallation tor browser
-i )
fscript_install || f_help
fscript_install
exit ;; # installation du script dans le système
-r | --remove | sysremove )
fscript_remove || f_help
fscript_remove
exit ;; # désinstallation du script
-u | --upgrade | upgrade )
opType="upgrade"
fscript_update || f_help
fscript_update
ffx_pers_upgrade
f_tb_pers_upgrade
exit ;; # upgrade script & personnalisations

View File

@ -2,6 +2,10 @@
## todo
## 3.2.0 03/09/2017
* révision appel fscript_remove, fscript_install & fscript_update
* fix bug mineur: ffx_pers_install si utilisation en root
## 3.1.0 02/09/2017