summaryrefslogtreecommitdiff
path: root/recipes-connectivity/ppp/files/init.patch
blob: 333c428e9d859ea1cf8676fc92d1b987a3d9cf39 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
diff -Naru orig/init new/init
--- orig/init	2021-10-26 09:22:52.464566921 -0500
+++ new/init	2021-10-26 09:24:31.144568910 -0500
@@ -8,6 +8,15 @@
 
 # Source function library.
 . /etc/init.d/functions
+. /etc/default/ppp
+if [[ $RADIORESETWAIT == yes ]] ; then
+    WAITFORRESET=/usr/bin/mts-wait-for-cell-reset
+else
+    WAITFORRESET=":"
+fi
+
+mkdir -p /run/ppp || true
+touch /run/ppp/resolv.conf
 
 test -x /usr/sbin/pppd -a -f /etc/ppp/ppp_on_boot || exit 0
 if [ -x /etc/ppp/ppp_on_boot ]; then RUNFILE=1; fi
@@ -15,7 +24,9 @@
 case "$1" in
   start)
       echo -n "Starting up PPP link: pppd"
+      ${WAITFORRESET}
       if [ "$RUNFILE" = "1" ]; then
+        logger "ppp_on_boot"
         /etc/ppp/ppp_on_boot
       else
         pppd call provider
@@ -37,13 +48,15 @@
     ;;
   restart|force-reload)
     echo -n "Restarting PPP link: pppd"
-    if [ "$RUNFILE" = "1" ]; then      
+    if [ "$RUNFILE" = "1" ]; then
       poff
       sleep 5
+      ${WAITFORRESET}
       /etc/ppp/ppp_on_boot
-    else                  
+    else
       poff provider
       sleep 5
+      ${WAITFORRESET}
       pppd call provider
     fi
     echo "."