2017-08-27 15:35:08 +02:00
|
|
|
#!/bin/bash
|
|
|
|
|
2017-09-24 07:31:03 +02:00
|
|
|
version=24/09/2017
|
|
|
|
|
|
|
|
# $1=cmd si $2: nb de tentatives pour s'identifier, sinon 3 tentatives par défaut
|
2017-09-24 08:53:39 +02:00
|
|
|
f__sudo(){ # 24/09/2017
|
2017-09-24 07:31:03 +02:00
|
|
|
local nb
|
|
|
|
[ "$2" ] && nb="$2" || nb="3"
|
|
|
|
for (( i=1 ; i<="$nb" ; i++ )); do
|
2017-09-24 08:53:39 +02:00
|
|
|
su -c "$1"
|
2017-09-24 07:31:03 +02:00
|
|
|
[ "$?" == 0 ] && break
|
|
|
|
[ "$i" == "$nb" ] && echo " $nb échec d'authentification, recommencer"
|
|
|
|
done
|
|
|
|
unset i
|
|
|
|
}
|
2017-08-27 15:35:08 +02:00
|
|
|
|
2017-09-24 11:51:42 +02:00
|
|
|
# [$1=timeout en s (O pour désactiver timeout) [$2=message]]
|
|
|
|
f__pause(){ # 24/09/2017
|
|
|
|
local message="Appuyer sur une touche pour continuer"
|
|
|
|
[ "$2" ] && message="$2"
|
|
|
|
if [ "$1" ] && [ -z "$2" ]; then message+=" ou attendre $1""s"; fi
|
|
|
|
printf "$message"
|
|
|
|
if [ "$1" ]; then
|
|
|
|
read -n1 -t"$1" reply
|
|
|
|
else
|
|
|
|
read -n1 reply
|
|
|
|
fi
|
2017-09-24 10:15:32 +02:00
|
|
|
echo
|
|
|
|
}
|
2017-09-24 11:51:42 +02:00
|
|
|
|
2017-08-27 15:35:08 +02:00
|
|
|
if [ $EUID -ne 0 ]; then
|
|
|
|
echo "vous devez être ROOT pour installer les scripts dans le système"
|
2017-09-24 07:31:03 +02:00
|
|
|
f__sudo "./sdeb"
|
|
|
|
exit 1
|
2017-08-27 15:35:08 +02:00
|
|
|
fi
|
|
|
|
|
2017-08-27 17:57:48 +02:00
|
|
|
echo -e "\nInstallation des scripts sdeb"
|
|
|
|
echo -e "============================="
|
|
|
|
|
2017-08-27 15:35:08 +02:00
|
|
|
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
|
|
|
|
|
2017-09-11 09:24:36 +02:00
|
|
|
wget -O getThunderbird https://framagit.org/kyodev/kyopages/raw/master/scripts/getThunderbird
|
|
|
|
chmod +x getThunderbird
|
2017-08-27 15:35:08 +02:00
|
|
|
|
|
|
|
./getFirefox
|
2017-09-24 11:51:42 +02:00
|
|
|
f__pause 10
|
2017-08-27 15:35:08 +02:00
|
|
|
|
|
|
|
./getFlashPlayer
|
2017-09-24 11:51:42 +02:00
|
|
|
f__pause 10
|
2017-09-11 09:24:36 +02:00
|
|
|
|
|
|
|
./getThunderbird
|
2017-09-24 11:51:42 +02:00
|
|
|
f__pause 10
|
2017-09-24 10:15:32 +02:00
|
|
|
|
|
|
|
./getInfo -i
|
2017-09-24 11:51:42 +02:00
|
|
|
f__pause 10
|
2017-09-24 10:15:32 +02:00
|
|
|
|
|
|
|
./getIp -i
|
2017-09-24 11:51:42 +02:00
|
|
|
f__pause 10
|
2017-09-24 07:31:03 +02:00
|
|
|
|
|
|
|
exit 0
|
|
|
|
|
|
|
|
wget -O sdeb https://framagit.org/kyodev/kyopages/raw/master/scripts/sdeb
|
|
|
|
chmod +x sdeb && ./sdeb
|