File tree Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Expand file tree Collapse file tree 1 file changed +17
-7
lines changed Original file line number Diff line number Diff line change 1
1
#! /bin/bash
2
2
3
3
ask_password () {
4
- password=$( zenity --password --title=" Solucionar Errores en Deeppin 23" --text=" Por favor, ingresa tu contraseña de sudo:" )
5
- if [ $? -ne 0 ]; then
6
- echo " Cancelado por el usuario"
7
- exit 1
8
- fi
4
+ while true ; do
5
+ password=$( zenity --password --title=" Autenticación de sudo" --text=" Por favor, ingresa tu contraseña de sudo:" )
6
+
7
+ if [ $? -ne 0 ]; then
8
+ echo " Cancelado por el usuario"
9
+ exit 1
10
+ fi
11
+
12
+ echo " $password " | sudo -S echo " " & > /dev/null
13
+
14
+ if [ $? -eq 0 ]; then
15
+ break
16
+ else
17
+ zenity --error --text=" Error al aplicar la solución a Deepin 23 \nContraseña incorrecta. \nIngresa correctamente la clave sudo."
18
+ fi
19
+ done
9
20
}
10
21
11
22
if ! command -v zenity & > /dev/null; then
12
23
echo " Zenity no está instalado. Instálalo para continuar."
13
24
exit 1
14
25
fi
15
26
16
- ask_password
17
-
18
27
distribucion=$( lsb_release -s --d)
19
28
20
29
script_path=" /usr/bin/webapps-creator-ui/webapps-creator-ui.py"
21
30
22
31
if [[ " $distribucion " == " Deepin 23" ]]; then
23
32
echo " Asignando solución para Deepin 23"
33
+ ask_password # Pedir la contraseña solo si es Deepin 23
24
34
echo " $password " | sudo -S sed -i ' s/config\.write(desktop_file)/config\.write(desktop_file, space_around_delimiters=False)/' " $script_path "
25
35
fi
26
36
You can’t perform that action at this time.
0 commit comments