This commit is contained in:
kyodev 2017-09-06 12:46:32 +02:00
parent 6b1bafe889
commit cc4f74888f
2 changed files with 17 additions and 17 deletions

View File

@ -1,6 +1,6 @@
#!/bin/bash
version=3.5.0
version=3.6.0
date="06/09/2017"
projet="simpledeb"
contact="IRC freenode ##sdeb ou https://framagit.org/kyodev/kyopages/issues/"
@ -254,7 +254,7 @@ f_tb_get_version(){ # v06/09/2017
# installation TorBrowser, [$1 manuel, $2 archive]
f_tb_install(){ # v06/09/2017
[ $EUID -eq 0 ] || f__error "vous devez être ROOT pour installer Tor Browser"
[ "$EUID" -eq 0 ] || f__error "vous devez être ROOT pour installer Tor Browser"
[ "$verTorOnline" ] || f_tb_get_version
local dirTemp archi fileTemp recup_urlTb
if [ "$1" == "manuel" ]; then
@ -378,20 +378,20 @@ f_tb_pers_install(){ # v06/09/2017
verPersTbDL="$(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
# installation
if [ -d "$profilTor/chrome/" ] && [ "$(stat -c %U $profilTor/chrome/)" == "root" ]; then
if [ -d "$profilTor/chrome/" ] && [ "$(stat -c %U $profilTor/chrome/)" == "root" ] && [ "$EUID" -ne 0 ]; then
f__error "root propriétaire sur $profilTor/chrome/" "bug version de développement" \
"$GREEN""réinstaller la personnalisation avec les privilèges root pour corriger$COLOR"
fi
mkdir -p "$profilTor/chrome" # répertoire pour userChrome.css
chown "$user_:" "$profilTor/chrome/"
if [ -e "$profilTor/user.js" ] && [ "$(stat -c %U $profilTor/user.js)" == "root" ]; then
if [ -e "$profilTor/user.js" ] && [ "$(stat -c %U $profilTor/user.js)" == "root" ] && [ "$EUID" -ne 0 ]; then
f__error "root propriétaire de $profilTor/user.js" "bug version de développement" \
"$GREEN""réinstaller la personnalisation avec les privilèges root pour corriger$COLOR"
fi
cp "$dirTemp/user.js" "$profilTor"
chown "$user_:" "$profilTor/user.js"
if [ -e "$profilTor/chrome/userChrome.css" ] && \
[ "$(stat -c %U $profilTor/chrome/userChrome.css)" == "root" ]; then
[ "$(stat -c %U $profilTor/chrome/userChrome.css)" == "root" ] && [ "$EUID" -ne 0 ]; then
f__error "root propriétaire de $profilTor/chrome/userChrome.css" "bug version de développement" \
"$GREEN""réinstaller la personnalisation avec les privilèges root pour corriger$COLOR"
fi
@ -426,7 +426,7 @@ f_tb_pers_upgrade(){ # v05/09/2017
# désinstallation de Tor Browser
f_tb_remove(){ # v06/09/2017
[ $EUID -eq 0 ] || f__error "vous devez être ROOT pour désinstaller Tor Browser"
[ "$EUID" -eq 0 ] || f__error "vous devez être ROOT pour désinstaller Tor Browser"
if [ ! -d "$dirInstallTB/" ]; then
f__info "$GREEN""Tor Browser n'est pas installé."
return 0
@ -513,7 +513,7 @@ echo "$COLOR"
# installation Firefox, $1 produit, $2 manuel, $3 archive
ffx_install(){ # v06/09/2017
[ $EUID -eq 0 ] || f__error "vous devez être ROOT pour installer Firefox"
[ "$EUID" -eq 0 ] || f__error "vous devez être ROOT pour installer Firefox"
local versionArchive dirTemp fileTemp produit
produit="$1"
if [ "$2" == "manuel" ]; then
@ -646,20 +646,20 @@ ffx_pers_install(){ # v06/09/2017
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
# installation
if [ -d "$dirProfil/$canal/chrome/" ] && [ "$(stat -c %U $dirProfil/$canal/chrome/)" == "root" ]; then
if [ -d "$dirProfil/$canal/chrome/" ] && [ "$(stat -c %U $dirProfil/$canal/chrome/)" == "root" ] && [ "$EUID" -ne 0 ]; then
f__error "root propriétaire sur $dirProfil/$canal/chrome/" "bug version de développement" \
"$GREEN""réinstaller la personnalisation avec les privilèges root pour corriger$COLOR"
fi
mkdir -p "$dirProfil/$canal/chrome" # répertoire pour userChrome.css
chown "$user_:" "$dirProfil/$canal/chrome"
if [ -e "$dirProfil/$canal/user.js" ] && [ "$(stat -c %U "$dirProfil/$canal/user.js")" == "root" ]; then
if [ -e "$dirProfil/$canal/user.js" ] && [ "$(stat -c %U "$dirProfil/$canal/user.js")" == "root" ] && [ "$EUID" -ne 0 ]; then
f__error "root propriétaire de $dirProfil/$canal/user.js" "bug version de développement" \
"$GREEN""réinstaller la personnalisation avec les privilèges root pour corriger$COLOR"
fi
cp "$dirTemp/user.js" "$dirProfil/$canal/"
chown "$user_:" "$dirProfil/$canal/user.js"
if [ -e "$dirProfil/$canal/chrome/userChrome.css" ] && \
[ "$(stat -c %U "$dirProfil/$canal/chrome/userChrome.css")" == "root" ]; then
[ "$(stat -c %U "$dirProfil/$canal/chrome/userChrome.css")" == "root" ] && [ "$EUID" -ne 0 ]; then
f__error "root propriétaire de $dirProfil/$canal/chrome/userChrome.css" "bug version de développement" \
"$GREEN""réinstaller la personnalisation avec les privilèges root pour corriger$COLOR"
fi
@ -755,8 +755,8 @@ ffx_recup_url(){
}
# désinstallation de Firefox, on laisse le profil user
ffx_remove(){ # v31/08/2017
[ $EUID -eq 0 ] || f__error "vous devez être ROOT pour désinstaller firefox"
ffx_remove(){ # v06/09/2017
[ "$EUID" -eq 0 ] || f__error "vous devez être ROOT pour désinstaller firefox"
killall "/opt/usr/share/firefox-$produit/firefox" &>/dev/null
# si pas de lanceur desktop, on considère que ce canal Firefox n'est pas installé, retour
if [ ! -e "/usr/share/applications/firefox-$produit.desktop" ]; then # si test répertoire, on détecterait pas l'ancien répertoire éventuel
@ -810,7 +810,7 @@ fscript_cronAnacron(){ # v06/09/2017
dirAnacron="/home/$user_/.config/anacron"
dirSpool="$dirAnacron/spool"
fileAnacron="$dirAnacron/$script.anacrontab"
[ $EUID -eq 0 ] && sed -i "/$script.anacrontab/d" /etc/crontab
[ "$EUID" -eq 0 ] && sed -i "/$script.anacrontab/d" /etc/crontab
case "$1" in
install | upgrade )
mkdir -p "$dirAnacron"
@ -823,7 +823,7 @@ fscript_cronAnacron(){ # v06/09/2017
# création spool anacron utilisateur
mkdir -p "$dirSpool"
chown -R "$user_:" "$dirAnacron" "$dirSpool"
if [ $EUID -eq 0 ]; then
if [ "$EUID" -eq 0 ]; then
# crontab pour activation horaire anacron
echo "@hourly $user_ /usr/sbin/anacron -t $fileAnacron -S $dirSpool" >> /etc/crontab
fi
@ -865,7 +865,7 @@ fscript_install(){ # v06/09/2017
f__info "$RED""l'installation dans le système doit se faire depuis un script local $GREEN(./$script -i )$COLOR"
return
fi
if [ $EUID -ne 0 ]; then
if [ "$EUID" -ne 0 ]; then
f__info "$RED""vous devez être ROOT pour installer ce script dans le système$COLOR"
return 3
fi
@ -906,7 +906,7 @@ fscript_remove(){ # v06/09/2017
f__info "$RED$script n'est pas installé$COLOR"
return 2
fi
if [ $EUID -ne 0 ]; then
if [ "$EUID" -ne 0 ]; then
f__info "$RED""vous devez être ROOT pour supprimer ce script dans le système$COLOR"
return 3
fi

View File

@ -2,7 +2,7 @@
## todo
## 3.5.0 06/09/2017
## 3.6.0 06/09/2017
* mineur: présentation version, espaces au lieu de Tabs
* fix bug droits sur personnalisation (root sur version dev?) ffx_pers_install