modemmonitortoggle may take an argument "on" or "off" to force toggling to a desired state
Signed-off-by: Anjandev Momi <anjan@momi.ca>
This commit is contained in:
parent
c915de82d8
commit
17e3b623bf
1 changed files with 7 additions and 2 deletions
|
@ -1,7 +1,12 @@
|
|||
#!/usr/bin/env sh
|
||||
if pgrep -f sxmo_modemmonitor.sh; then
|
||||
|
||||
# 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.
|
||||
|
||||
if [ "$1" != "on" ] && pgrep -f sxmo_modemmonitor.sh; then
|
||||
pgrep -f sxmo_modemmonitor.sh | grep -Ev "^${$}$" | xargs -IP kill -TERM P
|
||||
else
|
||||
elif [ "$1" != "off" ]; then
|
||||
setsid -f sxmo_modemmonitor.sh &
|
||||
fi
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue