shellcheck fixes

This commit is contained in:
Tobias Powalowski 2023-01-09 18:17:27 +01:00
parent 05e015fae9
commit 2420eb1be0

View file

@ -33,8 +33,8 @@ _abort()
} }
_dohwclock() { _dohwclock() {
echo "0.0 0 0.0" > /etc/adjtime echo 0.0 0 0.0 > /etc/adjtime
echo "0" >> /etc/adjtime echo 0 >> /etc/adjtime
[[ "${_HARDWARECLOCK}" = "UTC" ]] && echo UTC >> /etc/adjtime [[ "${_HARDWARECLOCK}" = "UTC" ]] && echo UTC >> /etc/adjtime
[[ "${_HARDWARECLOCK}" = "" ]] && echo LOCAL >> /etc/adjtime [[ "${_HARDWARECLOCK}" = "" ]] && echo LOCAL >> /etc/adjtime
if [[ "${_HARDWARECLOCK}" = "UTC" ]]; then if [[ "${_HARDWARECLOCK}" = "UTC" ]]; then
@ -53,7 +53,7 @@ _dohwclock() {
_dotimezone () { _dotimezone () {
_SET_ZONE="" _SET_ZONE=""
while ! [[ "${_SET_ZONE}" = "1" ]]; do while [[ -z "${_SET_ZONE}" ]]; do
_REGIONS="America - Europe - Africa - Asia - Australia -" _REGIONS="America - Europe - Africa - Asia - Australia -"
#shellcheck disable=SC2086 #shellcheck disable=SC2086
_dialog --menu "Please Select A Region:" 12 40 7 ${_REGIONS} 2>${_ANSWER} _dialog --menu "Please Select A Region:" 12 40 7 ${_REGIONS} 2>${_ANSWER}
@ -66,7 +66,7 @@ _dotimezone () {
_dialog --menu "Please Select A Timezone:" 22 40 16 ${_ZONES} 2>${_ANSWER} && _SET_ZONE="1" _dialog --menu "Please Select A Timezone:" 22 40 16 ${_ZONES} 2>${_ANSWER} && _SET_ZONE="1"
_ZONE=$(cat ${_ANSWER}) _ZONE=$(cat ${_ANSWER})
[[ "${_ZONE}" == "${_REGION}" ]] || _ZONE="${_REGION}/${_ZONE}" [[ "${_ZONE}" == "${_REGION}" ]] || _ZONE="${_REGION}/${_ZONE}"
if [[ "${_SET_ZONE}" = "1" ]]; then if [[ -n "${_SET_ZONE}" ]]; then
_dialog --infobox "Setting Timezone to ${_ZONE} ..." 0 0 _dialog --infobox "Setting Timezone to ${_ZONE} ..." 0 0
echo "${_ZONE}" > /tmp/.timezone echo "${_ZONE}" > /tmp/.timezone
timedatectl set-timezone "${_ZONE}" timedatectl set-timezone "${_ZONE}"
@ -106,18 +106,18 @@ _dotimeset() {
_SET_TIME="1" _SET_TIME="1"
fi fi
fi fi
if [[ "${_SET_TIME}" == "" ]]; then if [[ -z "${_SET_TIME}" ]]; then
timedatectl set-ntp 0 timedatectl set-ntp 0
# display and ask to set date/time # display and ask to set date/time
_CANCEL="" _CANCEL=""
dialog --calendar "Set the date.\nUse <TAB> to navigate and arrow keys to change values." 0 0 0 0 0 2> ${_ANSWER} || _CANCEL="1" dialog --calendar "Set the date.\nUse <TAB> to navigate and arrow keys to change values." 0 0 0 0 0 2> ${_ANSWER} || _CANCEL="1"
if [[ "${_CANCEL}" = "1" ]]; then if [[ -n "${_CANCEL}" ]]; then
_S_NEXTITEM="2" _S_NEXTITEM="2"
return 1 return 1
fi fi
_DATE="$(cat ${_ANSWER})" _DATE="$(cat ${_ANSWER})"
dialog --timebox "Set the time.\nUse <TAB> to navigate and up/down to change values." 0 0 2> ${_ANSWER} || _CANCEL="1" dialog --timebox "Set the time.\nUse <TAB> to navigate and up/down to change values." 0 0 2> ${_ANSWER} || _CANCEL="1"
if [[ "${_CANCEL}" = "1" ]]; then if [[ -n "${_CANCEL}" ]]; then
_S_NEXTITEM="2" _S_NEXTITEM="2"
return 1 return 1
fi fi