sxmo-utils/scripts/core/sxmo_terminal.sh
Maarten van Gompel eb34a970cb
TERMMODE was used but not set in sxmo_modemtext.sh + sanity check for sxmo_terminal
(fixed the shellcheck problem)

Signed-off-by: Stacy Harper <contact@stacyharper.net>
2021-05-23 14:37:11 +02:00

18 lines
350 B
Bash
Executable file

#!/usr/bin/env sh
TERMMODE=$([ -n "$SSH_CLIENT" ] || [ -n "$SSH_TTY" ] && echo "true")
if [ "$TERMMODE" = "true" ]; then
while [ "-e" != "$1" ] || [ 0 -eq $# ]; do
shift
done
shift
else
set -- st "$@"
fi
if [ -z "$*" ]; then
echo "sxmo_terminal.sh called in TERMMODE without any arguments (returning, nothing to do)" >&2
else
exec "$@"
fi