mirror of
https://gitlab.archlinux.org/tpowa/archboot.git
synced 2024-09-20 03:50:37 +02:00
remove while loop
This commit is contained in:
parent
35061e8a9a
commit
f32049aab1
1 changed files with 11 additions and 19 deletions
|
@ -89,25 +89,17 @@ _timeset() {
|
||||||
fi
|
fi
|
||||||
if [[ -z "${_SET_TIME}" ]]; then
|
if [[ -z "${_SET_TIME}" ]]; then
|
||||||
timedatectl set-ntp 0
|
timedatectl set-ntp 0
|
||||||
_CONTINUE=""
|
|
||||||
while [[ -z "${_CONTINUE}" ]]; do
|
|
||||||
# display and ask to set date/time
|
# display and ask to set date/time
|
||||||
if _dialog --title ' Date Setting' --calendar "Use <TAB> to navigate and arrow keys to change values." 0 0 0 0 0 2> ${_ANSWER}; then
|
if _dialog --title ' Date Setting' --calendar "Use <TAB> to navigate and arrow keys to change values." 0 0 0 0 0 2> ${_ANSWER}; then
|
||||||
_DATE="$(cat ${_ANSWER})"
|
_DATE="$(cat ${_ANSWER})"
|
||||||
_CONTINUE=1
|
|
||||||
else
|
else
|
||||||
_abort
|
_timeset
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
_CONTINUE=""
|
|
||||||
while [[ -z "${_CONTINUE}" ]]; do
|
|
||||||
if _dialog --title ' Time Setting ' --timebox "Use <TAB> to navigate and up/down to change values." 0 0 2> ${_ANSWER}; then
|
if _dialog --title ' Time Setting ' --timebox "Use <TAB> to navigate and up/down to change values." 0 0 2> ${_ANSWER}; then
|
||||||
_TIME="$(cat ${_ANSWER})"
|
_TIME="$(cat ${_ANSWER})"
|
||||||
_CONTINUE=1
|
|
||||||
else
|
else
|
||||||
_abort
|
_timeset
|
||||||
fi
|
fi
|
||||||
done
|
|
||||||
# save the time
|
# save the time
|
||||||
# DD/MM/YYYY hh:mm:ss -> YYYY-MM-DD hh:mm:ss
|
# DD/MM/YYYY hh:mm:ss -> YYYY-MM-DD hh:mm:ss
|
||||||
_DATETIME="$(echo "${_DATE}" "${_TIME}" | sed 's#\(..\)/\(..\)/\(....\) \(..\):\(..\):\(..\)#\3-\2-\1 \4:\5:\6#g')"
|
_DATETIME="$(echo "${_DATE}" "${_TIME}" | sed 's#\(..\)/\(..\)/\(....\) \(..\):\(..\):\(..\)#\3-\2-\1 \4:\5:\6#g')"
|
||||||
|
|
Loading…
Reference in a new issue