Parcourir la source

Use zenity for mesh identity reset

Bob Mottram il y a 7 ans
Parent
révision
af9806f462
1 fichiers modifiés avec 17 ajouts et 23 suppressions
  1. 17
    23
      src/freedombone-mesh-reset

+ 17
- 23
src/freedombone-mesh-reset Voir le fichier

@@ -33,28 +33,22 @@ export TEXTDOMAINDIR="/usr/share/locale"
33 33
 
34 34
 MESH_INSTALL_COMPLETED=/root/.mesh_setup_completed
35 35
 
36
-dialog --title $"New Identity" \
37
-       --backtitle $"Freedombone Mesh" \
38
-       --defaultno \
39
-       --yesno $"\nDo you want to reset your identity? This will reset ALL data for this peer, and you will not be able to recover it." 8 60
40
-sel=$?
41
-case $sel in
42
-    0) sudo batman stop
43
-       sudo pkill qtox
44
-       sudo pkill firefox
45
-       sudo pkill iceweasel
46
-       sudo pkill midori
47
-       sudo pkill patchwork
48
-       sudo rm -f $MESH_INSTALL_COMPLETED
49
-       sudo ${PROJECT_NAME}-image-mesh $USER new
50
-       sudo batman start
51
-       if [ -f $HOME/mesh-desktop.sh ]; then
52
-           $HOME/mesh-desktop.sh
53
-       else
54
-           dialog --title $"New Identity" \
55
-                  --msgbox $"You now have a new identity" 6 40
56
-       fi
57
-       ;;
58
-esac
36
+if ! zenity --question --title='New Identity' --text="Do you want to reset your identity? This will reset ALL data for this peer, and you will not be able to recover it." --ok-label=No --cancel-label=Yes; then
37
+    sudo batman stop
38
+    sudo pkill qtox
39
+    sudo pkill firefox
40
+    sudo pkill iceweasel
41
+    sudo pkill midori
42
+    sudo pkill patchwork
43
+    sudo rm -f $MESH_INSTALL_COMPLETED
44
+    sudo ${PROJECT_NAME}-image-mesh $USER new
45
+    sudo batman start
46
+    if [ -f $HOME/mesh-desktop.sh ]; then
47
+        $HOME/mesh-desktop.sh
48
+    else
49
+        dialog --title $"New Identity" \
50
+               --msgbox $"You now have a new identity" 6 40
51
+    fi
52
+fi
59 53
 
60 54
 exit 0