meta-somdevices: ppp: Changed ip-up.local, ip-down.local and options-mobile.base.
authorJosep Orga <jorga@somdevices.com>
Thu, 15 Apr 2021 17:28:24 +0000 (19:28 +0200)
committerJosep Orga <jorga@somdevices.com>
Thu, 15 Apr 2021 17:28:24 +0000 (19:28 +0200)
· ip-up.local based on ./ip-up.d/000resolvconf to properly set DNS to /etc/resolv.conf file.
· ip-down.local based on ./ip-down.d/000resolvconf to properly delete DNS to /etc/resolv.conf file.
· options-mobile.base to connect properly to our miniPCIe modems.

Signed-off-by: Josep Orga <jorga@somdevices.com>
recipes-connectivity/ppp/ppp/ip-down.local
recipes-connectivity/ppp/ppp/ip-up.local
recipes-connectivity/ppp/ppp/options-mobile.base

index 13132f1..dc536e7 100755 (executable)
@@ -1,17 +1,8 @@
 #!/bin/sh
 
-#by zhuhaiyan 201207119, for exe script when disconnect from internet
-
 trap "" SIGTERM
 
-killall pppd
-killall salestracking
-killall salestracking.sh
+[ -x /sbin/resolvconf ] || exit 0
+/sbin/resolvconf -f -d "$PPP_IFACE"
 
-#if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
-       if [ -f /etc/ppp/resolv.prev ]; then
-               cp -f /etc/ppp/resolv.prev /etc/resolv.conf
-       else
-               rm -f /etc/resolv.conf
-       fi
-#fi
+killall pppd
index 0d97133..e52e437 100755 (executable)
@@ -1,23 +1,10 @@
+#!/bin/sh
 
-#
-# This sample code shows you one way to modify your setup to allow automatic
-# configuration of your resolv.conf for peer supplied DNS addresses when using
-# the `usepeerdns' option.
-#
-# In my case I just added this to my /etc/ppp/ip-up.local script. You may need to 
-# create an executable script if one does not exist.
-#
-# Nick Walker (nickwalker@email.com)
-#
+[ -x /sbin/resolvconf ] || exit 0
 
-if [ -n "$USEPEERDNS" -a -f /etc/ppp/resolv.conf ]; then
-       rm -f /etc/ppp/resolv.prev
-       if [ -f /etc/resolv.conf ]; then
-               cp /etc/resolv.conf /etc/ppp/resolv.prev
-               grep domain /etc/ppp/resolv.prev > /etc/resolv.conf
-               grep search /etc/ppp/resolv.prev >> /etc/resolv.conf
-               cat /etc/ppp/resolv.conf >> /etc/resolv.conf
-       else
-               cp /etc/ppp/resolv.conf /etc
-       fi
-fi
+if [ -n "$DNS1" -o -n "$DNS2" ]; then
+       conf="# Generated by ppp.ip-up for $PPP_IFACE\n"
+       [ -n "$DNS1" ] && conf="${conf}nameserver $DNS1\n"
+       [ -n "$DNS2" ] && conf="${conf}nameserver $DNS2\n"
+       printf "$conf" | /sbin/resolvconf -a "$PPP_IFACE"
+fi
\ No newline at end of file