Skip to content

Commit 5f32c7f

Browse files
committed
feat: dialogs for setup and maintenance
1 parent ba9cb6c commit 5f32c7f

3 files changed

Lines changed: 7 additions & 7 deletions

File tree

‎system/cuos/app.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ download_image() {
6363

6464
while true; do
6565
check_rollback
66-
echo "Pulling $IMAGE_PATH ... (Digest should be ${IMAGE_DIGEST}, but is ${CURRENT_IMAGE_DIGEST})"
66+
echo "Pulling $IMAGE_PATH ... (Digest should be ${IMAGE_DIGEST})"
6767
if docker pull "${INITIAL_IMAGE}"; then
6868
CURRENT_IMAGE_DIGEST=$(docker image inspect --format '{{index .RepoDigests 0}}' "${IMAGE_PATH}" 2>/dev/null | cut -d'@' -f2)
6969
if [[ -n "${CURRENT_IMAGE_DIGEST}" && "${CURRENT_IMAGE_DIGEST}" = "${IMAGE_DIGEST}" ]]; then

‎system/cuos/dialog-maintenance.sh‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -232,7 +232,7 @@ diagnostics_dns() {
232232
expert() {
233233
confirm=$(DIALOGRC="${SCRIPT_DIR}/dialog-red.rc" term cuos_dialog --title "Expert Settings" --inputbox "You found the hidden expert settings.\nOnly continue, when you know what you are doing." 13 72 3>&1 1>&2 2>&3) || return 1
234234
if [[ "$confirm" != "CuOS" ]]; then msg "Aborted." "Expert Settings"; return 1; fi
235-
vim "+set backupcopy=yes" /system.json
235+
term vim "+set backupcopy=yes" /system.json
236236
}
237237

238238

‎system/cuos/lib-dialog.sh‎

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ if [[ "${VIRT_TYPE}" == "lxc" ]]; then
88
fi
99

1010
cuos() {
11-
[[ -n "${TEST}" ]] && return
11+
[[ -n "${TEST:-}" ]] && return
1212
"${SCRIPT_DIR}/api.sh" "$@"
1313
}
1414
export -f cuos
@@ -17,11 +17,11 @@ CUOS_VERSION="$(cuos version)"
1717
CUOS_VERSION="${CUOS_VERSION/*\//}"
1818

1919
term() {
20-
if [[ -n "${TEST}" ]]; then "$@"; return; fi
20+
if [[ -n "${TEST:-}" ]]; then "$@"; return; fi
2121
TERM=linux "$@" >/dev/tty42 </dev/tty42
2222
}
2323
term_output() {
24-
if [[ -n "${TEST}" ]]; then "$@"; return; fi
24+
if [[ -n "${TEST:-}" ]]; then "$@"; return; fi
2525
TERM=linux "$@" >/dev/tty42
2626
}
2727

@@ -39,7 +39,7 @@ cuos_dialog() {
3939

4040
change_vt() {
4141
#alternative: TERM=linux setsid -w openvt -s -e -w -- dialog --clear --yesno Hi 6 40
42-
if [[ -z "${TEST}" && -z "${DIALOG_SUB}" ]]; then
42+
if [[ -z "${TEST:-}" && -z "${DIALOG_SUB}" ]]; then
4343
export DIALOG_SUB=1
4444

4545
VT_OLD="$(fgconsole)"
@@ -124,7 +124,7 @@ valid_ipv4() {
124124

125125

126126

127-
if [[ -n "${TEST}" && "$(uname)" = "Darwin" ]]; then
127+
if [[ -n "${TEST:-}" && "$(uname)" = "Darwin" ]]; then
128128
sed() {
129129
gsed "$@"
130130
}

0 commit comments

Comments
 (0)