From 653542870dcbdf735f14824f546d00f371f48e15 Mon Sep 17 00:00:00 2001 From: Jonathon Hall Date: Tue, 6 Aug 2024 09:46:47 -0400 Subject: [PATCH] change-time: Improve prompt wording Adjust prompt wording when entering fields. Technically the desired value isn't always between min/max, because min and max are also acceptable :) No need to repeat an incorrect value, it is right there on the screen and it dilutes the important point describing what value is needed. Signed-off-by: Jonathon Hall --- initrd/bin/change-time | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/initrd/bin/change-time b/initrd/bin/change-time index b461049f..7f1de885 100755 --- a/initrd/bin/change-time +++ b/initrd/bin/change-time @@ -3,8 +3,8 @@ clear -echo -e -n "Please enter the date and time you wish to set\n" -echo -e -n "You need to set the time according to the UTC/GMT timezone please check https://time.is/UTC\n\n" +echo -e -n "Please enter the current date and time in UTC\n" +echo -e -n "To find the current date and time in UTC, please check https://time.is/UTC\n\n" get_date () { @@ -12,14 +12,15 @@ get_date () { field_name="$1" min="$2" max="$3" - echo "Please insert $field_name (between $min-$max)" + echo -n "Enter the current $field_name [$min-$max]: " read -r value echo #must be a number between $2 and $3 while [[ ! $value =~ ^[0-9]+$ ]] || [[ ${value#0} -lt $min ]] || [[ ${value#0} -gt $max ]]; - do - echo "$field_name is wrong: you entered \"$value\". Please try again, it must be a number between $min and $max" + do + echo "Please try again, it must be a number from $min to $max." + echo -n "Enter the current $field_name [$min-$max]: " read -r value echo done