Skip to content

Commit 62c8366

Browse files
JonathonHall-Purismtlaurion
authored andcommitted
key-init: If time resets, tell user to set it, but allow skipping
The 'warn' message was not very effective, because change-time.sh clears the screen right after. Prompt with whiptail instead, which also lets the user know what's happening before we drop them into a series of prompts. Let the user skip changing time if they really want to. While they usually should set the time, it's rather frustrating if Heads forces them to go through these prompts when they don't want to. Signed-off-by: Jonathon Hall <[email protected]> Signed-off-by: Thierry Laurion <[email protected]>
1 parent cbd1f28 commit 62c8366

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

initrd/bin/key-init

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/bash
22
set -e -o pipefail
33
. /etc/functions
4+
. /etc/gui_functions
45

56
TRACE_FUNC
67

@@ -9,8 +10,11 @@ TRACE_FUNC
910
# Good system clock is required for GPG to work properly.
1011
# if system year is less then 2024, prompt user to set correct time
1112
if [ "$(date +%Y)" -lt 2024 ]; then
12-
warn "System time is incorrect. Please set the correct time."
13-
change-time.sh
13+
if whiptail_warning --title "System Time Incorrect" \
14+
--yesno "The system time is incorrect. Please set the correct time." \
15+
0 80 --yes-button Continue --no-button Skip --clear; then
16+
change-time.sh
17+
fi
1418
fi
1519

1620
# Import user's keys if they exist

0 commit comments

Comments
 (0)