File tree Expand file tree Collapse file tree 2 files changed +14
-11
lines changed
Expand file tree Collapse file tree 2 files changed +14
-11
lines changed Original file line number Diff line number Diff line change 230230sleep 3
231231
232232stty -F $AT_CMUX clocal
233+ test -c $AT_CMUX
233234
235+ if [ $TRACE -gt 0 ]; then
236+ echo " Starting trace collection..."
237+ start-stop-daemon --start --pidfile $TRACE_PID_FILE --make-pidfile \
238+ --background --exec /bin/dd -- if=$MT_CMUX of=$MODEM_TRACE_FILE bs=1024
239+ fi
234240echo " Connect and wait for PPP link..."
235- test -c $AT_CMUX
236- test $TRACE -gt 0 && start-stop-daemon --start --pidfile $TRACE_PID_FILE --make-pidfile --background --exec /bin/dd -- if=$MT_CMUX of=$MODEM_TRACE_FILE bs=1024
237241
238242chat $CHATOPT -t$TIMEOUT " ${CHAT_SCRIPT[@]} " > $AT_CMUX < $AT_CMUX
239243
240244shutdown_modem () {
241245 set +eu
246+ start-stop-daemon --stop --pidfile $TRACE_PID_FILE --remove-pidfile --oknodo --retry 1
242247 chat $CHATOPT -t5 ' ' $SHUTDOWN_SCRIPT > $AT_CMUX < $AT_CMUX
243248 CHAT_ERR=$?
244- start-stop-daemon --stop --pidfile $TRACE_PID_FILE --remove-pidfile --oknodo
245249 pkill ldattach
246250 sleep 1
247251 if [ " $CHAT_ERR " -ne 0 ]; then
Original file line number Diff line number Diff line change @@ -8,17 +8,16 @@ PIDFILE="/var/run/nrf91-modem.pid"
88PPP_PIDFILE=" /var/run/ppp-nrf91.pid"
99TRACE_PID_FILE=" /var/run/nrf91-modem-trace.pid"
1010
11- # Request PPPD to terminate
12- if [ -f $PPP_PIDFILE ]; then
13- echo " Stopping PPP link..."
14- kill -SIGTERM $( head -1 < $PPP_PIDFILE )
15- fi
16-
1711# Stop trace collection
1812if [ -f $TRACE_PID_FILE ]; then
1913 echo " Stopping trace collection..."
20- kill $( cat $TRACE_PID_FILE ) 2> /dev/null || true
21- rm -f $TRACE_PID_FILE
14+ start-stop-daemon --stop --pidfile $TRACE_PID_FILE --remove-pidfile --oknodo --retry 1
15+ fi
16+
17+ # Request PPPD to terminate
18+ if [ -f $PPP_PIDFILE ]; then
19+ echo " Stopping PPP link..."
20+ start-stop-daemon --stop --pidfile $PPP_PIDFILE
2221fi
2322
2423# Wait for Shutdown script to complete
You can’t perform that action at this time.
0 commit comments