first-run-wizard: add to dialout grp, allow user to fix wrong area
authorGrazvydas Ignotas <notasas@gmail.com>
Thu, 9 Oct 2014 22:54:18 +0000 (01:54 +0300)
committerGrazvydas Ignotas <notasas@gmail.com>
Thu, 9 Oct 2014 22:54:18 +0000 (01:54 +0300)
recipes/pandora-system/pandora-first-run-wizard/first-run-wizard.sh

index 806df0d..8670882 100755 (executable)
@@ -89,7 +89,7 @@ while ! username=$(zenity --title="Enter your username" --entry --text "Please c
        zenity --title="Error" --error --text="Please try again." --timeout 6
 done
 
        zenity --title="Error" --error --text="Please try again." --timeout 6
 done
 
-while ! useradd -c "$name,,," -G adm,audio,cdrom,netdev,plugdev,users,video,wheel "$username" ; do
+while ! useradd -c "$name,,," -G adm,audio,cdrom,netdev,plugdev,users,video,wheel,dialout "$username" ; do
        username=$(zenity --title="Please check username" --entry --text "Please ensure that your username consists of only\nletters and numbers and is not already in use on the system." --entry-text "$username")
 done
 
        username=$(zenity --title="Please check username" --entry --text "Please ensure that your username consists of only\nletters and numbers and is not already in use on the system." --entry-text "$username")
 done
 
@@ -179,12 +179,14 @@ fi
 
 # Set the timezone and date/time
 
 
 # Set the timezone and date/time
 
-while ! area=$(zenity --list --title "Select your time zone" --text="Please select your area" --column="Select your area" --print-column=1 "Africa" "America" "Asia" "Australia" "Europe" "Pacific" --width=500 --height=260) || [ "x$area" = "x" ] ; do
+while [ "x$timezone" = "x" ]; do
+
+  while ! area=$(zenity --list --title "Select your time zone" --text="Please select your area" --column="Select your area" --print-column=1 "Africa" "America" "Asia" "Australia" "Europe" "Pacific" --width=500 --height=260) || [ "x$area" = "x" ] ; do
        zenity --title="Error" --error --text="Please select your area." --timeout=6
        zenity --title="Error" --error --text="Please select your area." --timeout=6
-done
+  done
+
+  timezone=$(ls -1 /usr/share/zoneinfo/$area | zenity ---width=500 --height=200 --title="Select your closest location" --list --column "Closest Location" --text "Please select the location closest to you")
 
 
-while ! timezone=$(ls -1 /usr/share/zoneinfo/$area | zenity ---width=500 --height=200 --title="Select your closest location" --list --column "Closest Location" --text "Please select the location closest to you") || [ "x$timezone" = "x" ] ; do
-       zenity --title="Error" --error --text="Please select your location." --timeout=6
 done
 
 echo $timezone
 done
 
 echo $timezone