Skip to content

Commit cd2d0a1

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

4 files changed

Lines changed: 9 additions & 3 deletions

File tree

‎system/Dockerfile‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ RUN apt-get update && apt-get install --no-install-recommends -y \
4242
docker-cli \
4343
docker.io \
4444
gnupg2 \
45+
inetutils-ping \
4546
jq \
4647
jsonschema-jv \
4748
kbd \

‎system/cuos/dialog-maintenance.sh‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ check_resources() {
199199
}
200200

201201
cuos_logs() {
202-
journalctl \
202+
term_all journalctl \
203203
-t cuos \
204204
--priority "emerg".."info" \
205205
--lines=2000 \
@@ -209,7 +209,7 @@ cuos_logs() {
209209
}
210210

211211
view_logs() {
212-
journalctl \
212+
term_all journalctl \
213213
--lines=10000 \
214214
--output=short \
215215
--no-hostname \
@@ -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-
term vim "+set backupcopy=yes" /system.json
235+
term_all vim "+set backupcopy=yes" /system.json
236236
}
237237

238238

‎system/cuos/dialog-reports.sh‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ change_vt
3535

3636
if [[ "${EXIT_CODE_DIALOG}" == "0" ]]; then
3737
"${SCRIPT_DIR}/dialog-maintenance.sh"
38+
term dialog --clear
3839
sleep 1
3940
else
4041
sleep 5

‎system/cuos/lib-dialog.sh‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ term() {
2020
if [[ -n "${TEST:-}" ]]; then "$@"; return; fi
2121
TERM=linux "$@" >/dev/tty42 </dev/tty42
2222
}
23+
term_all() {
24+
if [[ -n "${TEST:-}" ]]; then "$@"; return; fi
25+
TERM=linux "$@" >/dev/tty42 2>/dev/tty42 </dev/tty42
26+
}
2327
term_output() {
2428
if [[ -n "${TEST:-}" ]]; then "$@"; return; fi
2529
TERM=linux "$@" >/dev/tty42

0 commit comments

Comments
 (0)