forked from Xdavius/postinstall-debian
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpostinstall-debian-gui
52 lines (43 loc) · 1.9 KB
/
postinstall-debian-gui
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
#!/bin/bash
function main() {
if [ $DESKTOP_SESSION == "plasma" ]; then
password=$( kdialog --password "Entrez votre mot de passe SUDO" )
elif [ $DESKTOP_SESSION == "plasmawayland" ]; then
password=$( kdialog --password "Entrez votre mot de passe SUDO" )
elif [ $DESKTOP_SESSION == "gnome" ]; then
password=$( zenity --password --text="Entrez votre mot de passe SUDO" )
elif [ -f /usr/bin/zenity ]; then
password=$( zenity --password --text="Entrez votre mot de passe SUDO" )
fi
#password=$(echo $pwd)
chkroot=$(echo $password | sudo -S whoami)
if [ "$password" = "" ]; then
main
exit
elif [ "$chkroot" != "root" ]; then
if [ $DESKTOP_SESSION == "plasma" ]; then
kdialog --error "Mauvais mot de passe"
elif [ $DESKTOP_SESSION == "plasmawayland" ]; then
kdialog --error "Mauvais mot de passe"
elif [ $DESKTOP_SESSION == "gnome" ]; then
zenity --error --text="Mauvais mot de passe"
elif [ -f /usr/bin/zenity ]; then
zenity --error --text="Mauvais mot de passe"
fi
exit
fi
chmod +x data/*.sh
chmod +x extra/*.sh
chmod +x SECUREBOOT/*.sh
if [ -f /usr/bin/zenity ]; then
(echo $password | sudo -S apt -y install yad bash-completion) | zenity --progress --pulsate --title="Préparation de YAD" --text="Installation de YAD" --auto-close
elif [ -f /usr/bin/kdialog ]; then
echo $password | sudo -S apt install -y zenity
(echo $password | sudo -S apt -y install yad bash-completion pkexec) | zenity --progress --pulsate --title="Préparation de YAD" --text="Installation de YAD" --auto-close
fi
(echo $password | sudo -S apt-add-repository -y contrib && \
echo $password | sudo -S apt-add-repository -y non-free && \
echo $password | sudo -S dpkg --add-architecture i386) | yad --progress --pulsate --title "Préparation de système" --progress-text="installation des dépôts additionnels" --width 500 --height 100 --no-buttons --auto-close
echo $password | sudo -S bash -e ./source/menu-gui.sh
}
main