Kablersalat 9 сар өмнө
parent
commit
6c855ada4d
1 өөрчлөгдсөн 8 нэмэгдсэн , 10 устгасан
  1. 8 10
      kiosk.sh

+ 8 - 10
kiosk.sh

@@ -191,6 +191,7 @@ if [[ $1 == "--auto" ]]; then
 else
 dialog --title "WARNING !!!" --msgbox "Do not run this script under any user other than "kiosk" and make sure the Kiosk user has sudo rights for the duration of the installation. In addition check out the -h command on this script if you wish to do the installation more automated!" 10 50
   # Main menu for guided installation
+  current_step=1
   while true; do
     CHOICE=$(dialog --title "Rafisa Kiosk Configuration Menu" --menu "Choose an option:" 20 60 10 \
       1 "Install Required Packages" \
@@ -211,21 +212,18 @@ dialog --title "WARNING !!!" --msgbox "Do not run this script under any user oth
       *) echo "Invalid option. Try another one." >&2
     esac
 
-    # Automatically proceed because end users dont understand otherwise
+    # Automatically proceed to the next step if the previous step was successful
     if [ $? -eq 0 ]; then
-      case $CHOICE in
-        1) CHOICE=2 ;;
-        2) CHOICE=3 ;;
-        3) CHICE=4 ;;
-        4) CHOICE=5 ;;
-        5) CHOICE=6 ;;
-      esac
+      current_step=$((current_step + 1))
+      if [ $current_step -gt 5 ]; then
+        current_step=6
+      fi
     else
       dialog --title "Error" --msgbox "An error occurred. Please check the output and try again." 10 50
     fi
 
-    # safety ooooooo 
-    if [ $CHOICE -eq 6 ]; then
+    # Exit the loop if the last step is completed
+    if [ $current_step -eq 6 ]; then
       break
     fi
   done