Reinhard Russinger 3 жил өмнө
parent
commit
7087c805d5

+ 1 - 1
board/GfA/Display001/BUILD

@@ -1 +1 @@
-696
+697

+ 2 - 0
board/GfA/Display001/rootfs/etc/network/if-post-down.d/gfa-dns

@@ -2,6 +2,8 @@
 WRKPATH=/etc/network
 DESTFILE=/etc/resolv.conf
 
+/bin/sed --follow-symlinks -i "/\# $IFACE/d" $DESTFILE
+
 readarray -t DNSSERVERS < <(/usr/bin/awk -f $WRKPATH/readInterfaces.awk $WRKPATH/interfaces device=$IFACE output=dns-nameservers)
 for a in "${DNSSERVERS[@]}"; do
     if [[ ! -z $(/bin/grep "$a" "$DESTFILE") ]]; then

+ 1 - 1
board/GfA/Display001/rootfs/etc/network/if-up.d/gfa-dns

@@ -7,7 +7,7 @@ readarray -t DNSSERVERS < <(/usr/bin/awk -f $WRKPATH/readInterfaces.awk $WRKPATH
 for DNS in "${DNSSERVERS[@]}"; do
     if [[ -z $(/bin/grep "$DNS" "$DESTFILE") ]]; then
 #        /bin/sed --follow-symlinks -i "1 s/^/$a\n/" $DESTFILE
-        echo "$DNS" >> $DESTFILE
+        echo "$DNS # $IFACE" >> $DESTFILE
     fi         
 done    
 

+ 12 - 1
board/GfA/Display001/rootfs/etc/ppp/ip-down.d/gfa_dns

@@ -1,9 +1,20 @@
 #!/bin/bash
+# This script is called with the following arguments:
+#    Arg  Name                          Example
+#    $1   Interface name                ppp0
+#    $2   The tty                       ttyO1
+#    $3   The link speed                38400
+#    $4   Local IP number               12.34.56.78
+#    $5   Peer  IP number               12.34.56.99
+#    $6   Optional ``ipparam'' value    foo
+
 WRKPATH=/etc/ppp
 DESTFILE=/etc/resolv.conf
 
 if [ -e "$WRKPATH/resolv.conf" ]; then
-
+    
+    /bin/sed --follow-symlinks -i "/\# $1/d" $DESTFILE
+    
     readarray -t DNSSERVERS < <(cat $WRKPATH/resolv.conf)
 
     for DNS in "${DNSSERVERS[@]}"; do

+ 12 - 1
board/GfA/Display001/rootfs/etc/ppp/ip-up.d/gfa_dns

@@ -1,14 +1,25 @@
 #!/bin/bash
+# This script is called with the following arguments:
+#    Arg  Name                          Example
+#    $1   Interface name                ppp0
+#    $2   The tty                       ttyO1
+#    $3   The link speed                38400
+#    $4   Local IP number               12.34.56.78
+#    $5   Peer  IP number               12.34.56.99
+#    $6   Optional ``ipparam'' value    foo
+
 WRKPATH=/etc/ppp
 DESTFILE=/etc/resolv.conf
 
 if [ -e "$WRKPATH/resolv.conf" ]; then
 
+    /bin/sed --follow-symlinks -i "/\# $1/d" $DESTFILE
+    
     readarray -t DNSSERVERS < <(cat $WRKPATH/resolv.conf)
 
     for DNS in "${DNSSERVERS[@]}"; do
         if [[ -z $(/bin/grep "$DNS" "$DESTFILE") ]]; then
-            /bin/sed --follow-symlinks -i "1 s/^/$DNS\n/" $DESTFILE
+            /bin/sed --follow-symlinks -i "1 s/^/$DNS \# $1\n/" $DESTFILE
     #        echo "$DNS" #>> $DESTFILE
         fi
     done