Skip to content

Commit 99f385c

Browse files
authored
Update allsky-config.sh: Added ${USE_DIALOG}
1 parent 1a9cbdb commit 99f385c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

scripts/utilities/allsky-config.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ ALLOW_MORE_COMMANDS="true"
1919

2020
TITLE="*** Allsky Configuration ***"
2121

22+
# TODO: FIX: get rid of old whiptail code when we know this new code works
23+
USE_DIALOG="true" # Use the "dialog" command or older whiptail code
2224

2325
####################################### Functions - one per command
2426

@@ -30,7 +32,7 @@ function usage_and_exit()
3032
[[ ${1} == "--commands-only" ]] && COMMANDS_ONLY="true" && shift
3133

3234
local RET=${1}
33-
35+
3436
exec 2>&1
3537
echo
3638

@@ -579,11 +581,10 @@ function prompt()
579581
local OPTIONS=("${@}")
580582
local NUM_OPTIONS=$(( ${#OPTIONS[@]} / 2 ))
581583

582-
if true; then
583-
D_TITLE="*** Allsky Configuration ***"
584+
if [[ ${USE_DIALOG} == "true" ]]; then
584585
D_WIDTH="85"
585586
D_MENU_HEIGHT="${NUM_OPTIONS}"
586-
local OPT="$( dialog --no-tags --title "${D_TITLE}" \
587+
local OPT="$( dialog --no-tags --title "${TITLE}" \
587588
--default-item "${DEFAULT_MENU_ITEM}" \
588589
"--menu" "${PROMPT}" \
589590
"${T_LINES}" "${D_WIDTH}" "${D_MENU_HEIGHT}" "${OPTIONS[@]}" 3>&1 1>&2 2>&3 )"
@@ -826,7 +827,6 @@ if [[ -z ${FUNCTION_TO_EXECUTE} ]]; then
826827
continue
827828
fi
828829
P="${PROMPT}" # restore prompt
829-
830830

831831
[[ ${ON_TTY} == "true" ]] && clear
832832
run_command "${COMMAND}"

0 commit comments

Comments
 (0)