Fix time zone configuration loop
This commit is contained in:
15
chroot.sh
15
chroot.sh
@@ -8,22 +8,21 @@ password=""
|
|||||||
echoerr() { cat <<< "$@" 1>&2; }
|
echoerr() { cat <<< "$@" 1>&2; }
|
||||||
|
|
||||||
# Set the time zone
|
# Set the time zone
|
||||||
while
|
while true; do
|
||||||
echo "[INFO] Time zone configuration."
|
echo "[INFO] Time zone configuration."
|
||||||
read -p "Enter time zone (${timezone}): " input
|
read -p "Enter time zone (${timezone}): " input
|
||||||
|
|
||||||
if [[ -n "$input" ]]; then
|
if [[ -z "$input" ]]; then
|
||||||
break
|
break
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ ! -f "/usr/share/zoneinfo/${input}" ]]; then
|
if [[ -f "/usr/share/zoneinfo/${input}" ]]; then
|
||||||
echoerr "[ERROR] The selected time zone does not exist"
|
|
||||||
else
|
|
||||||
timezone="$input"
|
timezone="$input"
|
||||||
|
break
|
||||||
|
else
|
||||||
|
echoerr "[ERROR] The selected time zone does not exist"
|
||||||
fi
|
fi
|
||||||
|
done
|
||||||
[[ ! -f "/usr/share/zoneinfo/${input}" ]]
|
|
||||||
do true; done
|
|
||||||
|
|
||||||
echo "[INFO] Setting ${timezone} as the time zone"
|
echo "[INFO] Setting ${timezone} as the time zone"
|
||||||
ln -sf "/usr/share/zoneinfo/${timezone}" /etc/localtime
|
ln -sf "/usr/share/zoneinfo/${timezone}" /etc/localtime
|
||||||
|
|||||||
Reference in New Issue
Block a user