diff options
author | John Klug <john.klug@multitech.com> | 2021-09-03 18:42:16 -0500 |
---|---|---|
committer | John Klug <john.klug@multitech.com> | 2021-09-07 10:10:18 -0500 |
commit | 472e9af4cb161e5731e87fbafed0ca842c524a67 (patch) | |
tree | 13e0f469d6b33034f98241f03ff66932b4fd30bd /recipes-connectivity | |
parent | ece7909613ea32e3a1f60a77b781f3109a97c046 (diff) | |
download | meta-mlinux-472e9af4cb161e5731e87fbafed0ca842c524a67.tar.gz meta-mlinux-472e9af4cb161e5731e87fbafed0ca842c524a67.tar.bz2 meta-mlinux-472e9af4cb161e5731e87fbafed0ca842c524a67.zip |
Use exit and deregister with mts-io when done
Diffstat (limited to 'recipes-connectivity')
-rwxr-xr-x | recipes-connectivity/ppp/files/wait_for_reset | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/recipes-connectivity/ppp/files/wait_for_reset b/recipes-connectivity/ppp/files/wait_for_reset index 7e9da95..e77df77 100755 --- a/recipes-connectivity/ppp/files/wait_for_reset +++ b/recipes-connectivity/ppp/files/wait_for_reset @@ -13,7 +13,7 @@ TERM=15 function sleep_reset { # Wait for parent to enter wait. - trap "kill $!;kill $BASHPID" $TERM + trap "exit 0" $TERM while [[ $(ps -h -o wchan -p $PPID) != do_wait ]] ; do usleep 100 ; done ${LOG} Register for SIGUSR2 when radio-reset complete echo "$$" "$USR2" >/sys/devices/platform/mts-io/radio-reset-monitor @@ -29,17 +29,17 @@ function sleep_reset # Wait for radio-reset to complete function wait_for_reset { - # Wait for radio reset/modem discovery - trap ":" $USR2 - in_reset=$(cat /sys/devices/platform/mts-io/radio-udev-discovery) - if ((in_reset == 0)) ; then - sleep_reset & - wait $! - # pgrep is needed to find the sleep process - echo "pgrep -P: $(pgrep -P $!)" - pgrep -P $! | xargs kill - ${LOG} "radio-reset is complete" - - fi - trap "" $USR2 + # Wait for radio reset/modem discovery + trap ":" $USR2 + in_reset=$(cat /sys/devices/platform/mts-io/radio-udev-discovery) + if ((in_reset == 0)) ; then + sleep_reset & + wait $! + # pgrep is needed to find the sleep process + echo "pgrep -P: $(pgrep -P $!)" + pgrep -P $! | xargs kill + ${LOG} "radio-reset is complete" + fi + echo "$$" "0" >/sys/devices/platform/mts-io/radio-reset-monitor + trap "" $USR2 } |