- while ! time=$(zenity --title="Enter actual time" --entry --text "Please enter the time in 24hour format (HH:MM).\n\nThe screen might blank out after you changed the time.\nDon't panic. Simply press a button on the keyboard.\n" --entry-text "$time_h:$time_m") || [ "x$time" = "x" ] ; do
- zenity --title="Error" --error --text="Please input the time." --timeout 6
+ while true; do
+ time=$(zenity --title="Enter actual time" --entry --text "Please enter the time in 24hour format (HH:MM).\n\nThe screen might blank out after you changed the time.\nDon't panic. Simply press a button on the keyboard.\n" --entry-text "$time_h:$time_m") || exit 1
+ if test -n "$time" && date -d "$time"; then
+ break;
+ fi
+ zenity --title="Error" --error --text="Please input the time." --timeout 6