~mil/sxmo-utils

ref: eb34a970cbc21eb86997ebf7b4fea75b03d6240e sxmo-utils/scripts/core/sxmo_terminal.sh -rwxr-xr-x 350 bytes
eb34a970Maarten van Gompel TERMMODE was used but not set in sxmo_modemtext.sh + sanity check for sxmo_terminal 7 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/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