From eb34a970cbc21eb86997ebf7b4fea75b03d6240e Mon Sep 17 00:00:00 2001 From: Maarten van Gompel Date: Sat, 22 May 2021 17:06:22 +0200 Subject: [PATCH] TERMMODE was used but not set in sxmo_modemtext.sh + sanity check for sxmo_terminal (fixed the shellcheck problem) Signed-off-by: Stacy Harper --- scripts/core/sxmo_terminal.sh | 6 +++++- scripts/modem/sxmo_modemtext.sh | 2 ++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/scripts/core/sxmo_terminal.sh b/scripts/core/sxmo_terminal.sh index 18e2212..076749a 100755 --- a/scripts/core/sxmo_terminal.sh +++ b/scripts/core/sxmo_terminal.sh @@ -11,4 +11,8 @@ else set -- st "$@" fi -exec "$@" +if [ -z "$*" ]; then + echo "sxmo_terminal.sh called in TERMMODE without any arguments (returning, nothing to do)" >&2 +else + exec "$@" +fi diff --git a/scripts/modem/sxmo_modemtext.sh b/scripts/modem/sxmo_modemtext.sh index 6271866..863494c 100755 --- a/scripts/modem/sxmo_modemtext.sh +++ b/scripts/modem/sxmo_modemtext.sh @@ -4,6 +4,8 @@ # shellcheck source=scripts/core/sxmo_common.sh . "$(dirname "$0")/sxmo_common.sh" +TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true") + err() { echo "$1">&2 echo "$1" | dmenu -c -l 10