Prevent starting multiple modemmonitor on logout/login

Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
master
Stacy Harper 4 years ago committed by Maarten van Gompel
parent de0697a83c
commit 65270eaea8
  1. 4
      scripts/modem/sxmo_modemmonitortoggle.sh

@ -9,8 +9,8 @@
. "$(dirname "$0")/sxmo_common.sh" . "$(dirname "$0")/sxmo_common.sh"
if [ "$1" != "on" ] && pgrep -f sxmo_modemmonitor.sh; then if [ "$1" != "on" ] && pgrep -f sxmo_modemmonitor.sh; then
pgrep -f sxmo_modemmonitor.sh | grep -Ev "^${$}$" | xargs -IP kill -TERM P pkill -TERM -f sxmo_modemmonitor.sh
elif [ "$1" != "off" ]; then elif [ "$1" != "off" ] && ! pgrep -f sxmo_modemmonitor.sh; then
setsid -f sxmo_modemmonitor.sh & setsid -f sxmo_modemmonitor.sh &
fi fi

Loading…
Cancel
Save