sdeb 1.3.0

This commit is contained in:
kyodev 2017-10-16 07:07:41 +02:00
parent f66020ff9e
commit 61efe135a2
1 changed files with 72 additions and 53 deletions

View File

@ -1,6 +1,7 @@
#!/bin/bash
version=12/10/2017
version=1.0.0
date=16/10/2017
f__color(){ # 08/10/2017
YELLOW=$(tput setaf 3) # question
@ -64,66 +65,84 @@ f__pause(){ # 24/09/2017
echo
}
if [ $EUID -ne 0 ]; then
echo "vous devez être ROOT pour installer les scripts dans le système"
f__sudo "exec ./sdeb"
exit 0
help(){ # 16/10/2017
echo "$BOLD"
echo " téléchargement et installation scripts sdeb"
echo "$STD $version"
echo
echo " $0 all | script get..."
echo
echo " si all : traitements de tous les scripts"
echo " si option incorrecte: affichage de cette aide"
echo
exit 1
}
start(){ # 16/10/2017
f__color
if [ "$(which figlet)" ]; then
echo -e "$BOLD"
figlet -w120 " script sdeb" | tr '`' "'"
echo -e "$STD"
else
echo -e "$BOLD\nscripts sdeb"
echo -e "=============\n$STD"
fi
if [ $EUID -ne 0 ]; then
echo "vous devez être ROOT pour installer les scripts dans le système"
f__sudo "exec ./sdeb"
exit 0
fi
}
download(){ # 16/10/2017
local url
[ "$1" == "getInfo" ] && url="https://framagit.org/kyodev/kyopages/raw/master/scripts/getInfo"
[ "$1" == "getIp" ] && url="https://framagit.org/kyodev/kyopages/raw/master/scripts/getIp"
[ "$1" == "getFirefox" ] && url="https://framagit.org/kyodev/kyopages/raw/master/scripts/getFirefox"
[ "$1" == "getFlashPlayer" ] && url="https://framagit.org/kyodev/kyopages/raw/master/scripts/getFlashPlayer"
[ "$1" == "getThunderbird" ] && url="https://framagit.org/kyodev/kyopages/raw/master/scripts/getThunderbird"
wget -O "$1" "$url"
chmod +x "$1"
}
install(){ # 16/10/2017
[ -e "$1" ] && "./essai$1 -i"
f__pause 10
}
#------ départ script ----------------------------------------------------------
start
# traitement options
[[ "$1" =~ ^get || "$1" == "all" ]] || help # si appel incorrect, help
liste="getInfo getIp getFirefox getFlashPlayer getThunderbird"
echo -e "$BOLD\n chargement des scripts$STD\n"
if f__dialog_oui_non "oui" "charger les scripts?"; then
if [ "$1" == "all" ];then
for ifile in $liste; do
download "$ifile"
done
else
download "$1"
fi
fi
f__color
if [ "$(which figlet)" ]; then
figlet -w120 "script sdeb"
else
echo -e "$BOLD\nscripts sdeb"
echo -e "=============\n$STD"
fi
echo -e "$BOLD\nchargement des scripts"
echo -e "======================\n$STD"
if f__dialog_oui_non "oui" "charger les scripts?" ; then
echo 'chargement...'
wget -O getInfo https://framagit.org/kyodev/kyopages/raw/master/scripts/getInfo
chmod +x getInfo
wget -O getIp https://framagit.org/kyodev/kyopages/raw/master/scripts/getIp
chmod +x getIp
wget -O getFirefox https://framagit.org/kyodev/kyopages/raw/master/scripts/getFirefox
chmod +x getFirefox
wget -O getFlashPlayer https://framagit.org/kyodev/kyopages/raw/master/scripts/getFlashPlayer
chmod +x getFlashPlayer
wget -O getThunderbird https://framagit.org/kyodev/kyopages/raw/master/scripts/getThunderbird
chmod +x getThunderbird
fi
echo -e "$BOLD\ninstallation des scripts"
echo -e "========================\n$STD"
echo -e "$BOLD\ninstallation des scripts$STD\n"
if f__dialog_oui_non "oui" "installer les scripts?" ; then
./getIp -i
f__pause 10
./getInfo -i
f__pause 10
./getFirefox
f__pause 10
./getFlashPlayer
f__pause 10
./getThunderbird
f__pause 10
if [ "$1" == "all" ];then
for ifile in $liste; do
[ -e "$ifileS" ] && install "$ifile" || echo "$ifile absent"
done
else
[ -e "$ifile" ] && install "$1" || echo "$1 absent"
fi
fi
echo
exit 0
wget -O sdeb https://frama.link/sdeb
chmod +x sdeb && ./sdeb
wget -O sdeb https://framagit.org/kyodev/kyopages/raw/master/scripts/sdeb