From eddc020930aafa6d2af9e6b5d5f017ae5cb17418 Mon Sep 17 00:00:00 2001 From: kyodev Date: Mon, 25 Dec 2017 09:03:06 +0100 Subject: [PATCH] getXfox 4.4.0 --- scripts/getXfox | 65 +++++++++++++++++++----------------- scripts/getXfox_changelog.md | 15 ++++++++- 2 files changed, 49 insertions(+), 31 deletions(-) diff --git a/scripts/getXfox b/scripts/getXfox index ef4b07c..b040924 100755 --- a/scripts/getXfox +++ b/scripts/getXfox @@ -335,8 +335,9 @@ f_update_alternatives(){ # 23/12/2017 } # assigne $ver_tor_online, $ver_tor_install, [$1=quiet] -f_tor_get_version(){ # 23/12/2017 - local recup_url="https://www.torproject.org/projects/torbrowser.html.en" appli="Tor browser" fileTmp="/tmp/$script-getVersion_${appli// }" +f_tor_get_version(){ # 25/12/2017 + local recup_url="https://www.torproject.org/projects/torbrowser.html.en" + local fileTmp="/tmp/$script-getVersion_tor" appli="Tor browser" x_tor_get_version=1 # version online @@ -359,9 +360,9 @@ f_tor_get_version(){ # 23/12/2017 } # installation, [$1='manuel', $2 archive] -f_tor_install(){ # 23/12/2017 +f_tor_install(){ # 25/12/2017 local fileDesktop="/usr/share/applications/tor-browser.desktop" appli="Tor browser" - local verArchive fileTemp archi recup_urlTor dirTemp="/tmp/$script-install_${appli// }" + local verArchive fileTemp archi recup_urlTor dirTemp="/tmp/$script-install_tor" if [ "$EUID" -ne 0 ]; then f__info "vous devez être$RED ROOT$BLUE pour installer $appli dans le système" @@ -376,13 +377,11 @@ f_tor_install(){ # 23/12/2017 verArchive=$( sed -En 's/.*tor-browser-linux[0-9]{2}-(.*)\.tar\.xz.*$/\1/p' <<< $(basename $2) ) f__info "installation manuelle de $appli version $verArchive ($2)" fileTemp="$2" - mkdir -p "$dirTemp" else f__info "installation de $appli $ver_tor_online" (( x_tor_get_version == 1 )) || f_tor_get_version "quiet" [ "$fu_archi" == "linux" ] && archi="linux32" || archi="$fu_archi" fileTemp="$dirTemp/tor-browser-$archi-$ver_tor_online""_fr.tar.xz" - mkdir -p "$dirTemp" # téléchargement & test archive f__info " - téléchargement..." recup_urlTor="https://www.torproject.org/dist/torbrowser/$ver_tor_online/tor-browser-$archi-$ver_tor_online""_fr.tar.xz" @@ -391,6 +390,7 @@ f_tor_install(){ # 23/12/2017 fi f__archive_test "$fileTemp" || f__error "Le fichier $fileTemp n'est pas une archive tar.xz valide" echo + mkdir -p "$dirTemp" # décompression archive téléchargée dans dossier de travail f__info " - décompression..." tar -xaf "$fileTemp" -C "$dirTemp/" @@ -431,7 +431,7 @@ f_tor_install_manuel(){ # 23/12/2017 } # création lanceur desktop -f_tor_lanceur_desktop(){ # 23/12/2017 +f_tor_lanceur_desktop(){ # 25/12/2017 local appli="Tor browser" echo "[Desktop Entry]" > "$fileDesktop" @@ -440,7 +440,11 @@ f_tor_lanceur_desktop(){ # 23/12/2017 echo "StartupWMClass=$appli" >> "$fileDesktop" echo "Exec=$dirInstallTor/Browser/start-tor-browser --detach" >> "$fileDesktop" echo "X-TorBrowser-ExecShell=$dirInstallTor/Browser/start-tor-browser --detach" >> "$fileDesktop" - echo "Icon=$dirInstallTor/Browser/browser/chrome/icons/default/default48.png" >> "$fileDesktop" + if [ -e "$dirInstallTor/Browser/browser/icons/mozicon128.png" ]; then + echo "Icon=$dirInstallTor/Browser/browser/icons/mozicon128.png" >> "$fileDesktop" + else + echo "Icon=$dirInstallTor/Browser/browser/chrome/icons/default/default48.png" >> "$fileDesktop" + fi echo "Comment=$appli is +1 for privacy and -1 for mass surveillance" >> "$fileDesktop" echo "Comment[fr]=$appli est un PLUS pour la vie privée et un MOINS pour la surveillance de masse" >> "$fileDesktop" echo "GenericName=Web Browser" >> "$fileDesktop" @@ -475,8 +479,8 @@ f_tor_pers_get_version(){ # 24/12/2017 } # recup userTor.js et chrome/userChrome.css -f_tor_pers_install(){ # 23/12/2017 - local verPersTorDL appli="Tor browser" dirTemp="/tmp/$script-persInstall_${appli// }" +f_tor_pers_install(){ # 25/12/2017 + local verPersTorDL dirTemp="/tmp/$script-persInstall_tor" appli="Tor browser" if [ ! -d "$dirProfilTor/" ]; then # f__info "profil $appli inexistant" @@ -561,8 +565,8 @@ f_tor_remove(){ # 23/12/2017 } # assigne $ver_wfx_online $ver_wfx_install $recup_url_wfx, [$1=quiet] -f_wfx_get_version(){ # 24/12/2017 - local appli="Waterfox" fileTmp="/tmp/$script-getVersion_${appli// }" +f_wfx_get_version(){ # 25/12/2017 + local fileTmp="/tmp/$script-getVersion_wfx" appli="Waterfox" local recup_url="https://www.waterfoxproject.org/downloads" recup_urlWfx verWfOnline x_wfx_get_version=1 @@ -587,9 +591,9 @@ f_wfx_get_version(){ # 24/12/2017 } # installation, [$1='manuel', $2 archive] -f_wfx_install(){ # 23/12/2017 +f_wfx_install(){ # 25/12/2017 local fileDesktop="/usr/share/applications/waterfox.desktop" verArchive dirTemp fileTemp - local appli="Waterfox" dirTemp="/tmp/$script-install_${appli// }" + local dirTemp="/tmp/$script-install_wfx" appli="Waterfox" if [ "$EUID" -ne 0 ]; then f__info "vous devez être$RED ROOT$BLUE pour installer $appli dans le système" @@ -609,12 +613,10 @@ f_wfx_install(){ # 23/12/2017 verArchive=$( sed -E 's/.*waterfox-(.*)en-US\.linux.*$/\1/' <<< $( basename $2 ) ) f__info "installation manuelle de $appli version $verArchive" fileTemp="$2" - mkdir -p "$dirTemp" else (( x_wfx_get_version == 1 )) || f_wfx_get_version "quiet" f__info "installation $appli $ver_wfx_online" fileTemp="$dirTemp/$appli-$ver_wfx_online.en-US.linux-$fu_archi.tar.bz2" - mkdir -p "$dirTemp" # téléchargement & test archive f__info " - téléchargement..." wget -q -c --show-progress --tries=2 --timeout=15 --user-agent="$user_agent" -o "$wget_log" -O "$fileTemp" "$recup_url_wfx" @@ -622,7 +624,7 @@ f_wfx_install(){ # 23/12/2017 fi f__archive_test "$fileTemp" || f__error "Le fichier $fileTemp n'est pas une archive tar.bz2 valide" echo - + mkdir -p "$dirTemp" # décompression archive téléchargée dans dossier de travail f__info " - décompression..." tar -xaf "$fileTemp" -C "$dirTemp/" @@ -636,6 +638,8 @@ f_wfx_install(){ # 23/12/2017 chmod -R g+wrs,a+r "$dirInstallWfx/" rm -rf "$dirTemp/" + # finalisation utilisateur + f_wfx_profil_user # traitement finaux système ln -sf "$dirInstallWfx/browser/chrome/icons/default/default48.png" "/usr/share/pixmaps/waterfox.png" f_wfx_lanceur_desktop @@ -646,8 +650,6 @@ f_wfx_install(){ # 23/12/2017 chmod a+x "/usr/bin/waterfox" # update-alternatives f_update_alternatives "wfx" "/usr/bin/waterfox" - # finalisation utilisateur - f_wfx_profil_user if [ "$1" == "manuel" ]; then f__info "log" "archive $appli $verArchive installée" @@ -716,8 +718,8 @@ f_wfx_pers_get_version(){ # 24/12/2017 } # recup user.js et chrome/userChrome.css, à personnaliser ou mettre à jour -f_wfx_pers_install(){ # 23/12/2017 - local verPersDL appli="Waterfox" dirTemp="/tmp/$script-persInstall_${appli// }" +f_wfx_pers_install(){ # 25/12/2017 + local verPersDL dirTemp="/tmp/$script-persInstall_wfx" appli="Waterfox" if [ ! -d "$profilWfx" ]; then f__info "profil $appli inexistant" @@ -770,22 +772,23 @@ f_wfx_pers_upgrade(){ # 23/12/2017 } # traitement utilisateur, [$1='user'] si appel indépendant pour reconfiguration -f_wfx_profil_user(){ # 23/12/2017 +f_wfx_profil_user(){ # 25/12/2017 local nbProfiles appli="Waterfox" if [ ! -d "$dirInstallWfx" ] && [ "$1" == "user" ]; then f__info "$appli n'est pas installé" return 1 fi - if [ ! -e "$dirProfilWfx/profiles.ini" ]; then # si profile.ini inexistant, on crée profile.ini avec entête minimum - echo -e "[General]\nStartWithLastProfile=1" > "$dirProfilWfx/profiles.ini" - chown "$fu_user:" "$dirProfilWfx/profiles.ini" # propriété du fichier profile.ini à l'user - chmod u+rw,go+r "$dirProfilWfx/profiles.ini" # permissions du fichier profile.ini à l'user - fi + if [ ! -d "$profilWfx" ]; then # si répertoire profil cible inexistant mkdir -p "$profilWfx" # création répertoire chown -R "$fu_user:" "$profilWfx/" # propriété du répertoire profil à l'user chmod g-rx,o-rx "$profilWfx/" # droits répertoire + fi + if [ ! -e "$dirProfilWfx/profiles.ini" ]; then # si profile.ini inexistant, on crée profile.ini avec entête minimum + echo -e "[General]\nStartWithLastProfile=1" > "$dirProfilWfx/profiles.ini" + chown "$fu_user:" "$dirProfilWfx/profiles.ini" # propriété du fichier profile.ini à l'user + chmod u+rw,go+r "$dirProfilWfx/profiles.ini" # permissions du fichier profile.ini à l'user fi # inscription dans profil.ini, si profil pas déjà existant dans profil.ini if ! grep -q "Name=waterfox" "$dirProfilWfx/profiles.ini" ; then @@ -797,10 +800,12 @@ f_wfx_profil_user(){ # 23/12/2017 echo "Name=waterfox" >> "$dirProfilWfx/profiles.ini" echo "IsRelative=1" >> "$dirProfilWfx/profiles.ini" echo "Path=waterfox" >> "$dirProfilWfx/profiles.ini" - sed -i '/Default=1/d' "$dirProfilWfx/profiles.ini" # effacement éventuel Default=existant - echo "Default=1" >> "$dirProfilWfx/profiles.ini" # réinscription - echo "$( uniq $dirProfilWfx/profiles.ini )" > "$dirProfilWfx/profiles.ini" # suppression lignes vides en double fi + # Default=1 au dernier installé, si besoin autre utiliser u- + sed -i '/Default=1/d' "$dirProfilWfx/profiles.ini" # effacement éventuel Default=existant + echo "Default=1" >> "$dirProfilWfx/profiles.ini" # réinscription + echo "$( uniq $dirProfilWfx/profiles.ini )" > "$dirProfilWfx/profiles.ini" # suppression lignes vides en double + [ "$1" == "user" ] && f__info "log" "profil $appli configuré pour $fu_user" } diff --git a/scripts/getXfox_changelog.md b/scripts/getXfox_changelog.md index aa79735..dfd7fb6 100644 --- a/scripts/getXfox_changelog.md +++ b/scripts/getXfox_changelog.md @@ -1,6 +1,19 @@ # getXfox -## getXfox 4.3.0- 24/12/2017 + +todo, réviser + wfx lanceur option u + desktop icon waterfox + + +## getXfox 4.4.0 - 25/12/2017 + +* cosmétique +* révision: tor_install, wfx_install, wfx_profil_user +* révision: général, plus de variables composées avec variable dans local + + +## getXfox 4.3.0 - 24/12/2017 * cosmétique * fix: f__wget_test, incompatible avec redirection logs