~mil/sxmo-utils

ref: a3e4dc0fa47d4b73bf2c3d0f138e253abdbe982c sxmo-utils/scripts/modem/sxmo_modemmonitortoggle.sh -rwxr-xr-x 623 bytes
a3e4dc0fStacy Harper Make all sxmo menu SSH mode compatible 1 year, 4 months ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/usr/bin/env sh

# This script toggles the modem monitor
# It optionally takes a parameter "on" or "off"
# forcing it to toggle only to that desired state if applicable.

# include common definitions
# shellcheck source=scripts/core/sxmo_common.sh
. "$(dirname "$0")/sxmo_common.sh"

if [ "$1" != "on" ] && pgrep -f sxmo_modemmonitor.sh; then
	pkill -TERM -f sxmo_modemmonitor.sh
elif [ "$1" != "off" ] && ! pgrep -f sxmo_modemmonitor.sh; then
	setsid -f sxmo_modemmonitor.sh &
fi

rm "$NOTIFDIR"/incomingcall*

# E.g. wait until process killed or started -- maybe there's a better way..
sleep 1

sxmo_statusbarupdate.sh