summaryrefslogtreecommitdiff
path: root/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS
Side-by-side diff
Diffstat (limited to 'noncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS') (more/less context) (show whitespace changes)
-rwxr-xr-xnoncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS30
1 files changed, 30 insertions, 0 deletions
diff --git a/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS b/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS
new file mode 100755
index 0000000..55cec63
--- a/dev/null
+++ b/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS
@@ -0,0 +1,30 @@
+#!/bin/sh
+exec 2> /tmp/RES
+set -x
+CMD=`basename $0`
+RESOLV=/etc/resolv.conf
+FIXED=/etc/ppp/$6.fixed
+
+case $CMD in
+ U_*)
+ if [ -f $FIXED ]
+ then
+ # ADD FIXED dns ENTRIES
+ grep "nameserver " $FIXED >> "$RESOLV"
+ else
+ if [ "$DNS1" ] ; then
+ echo '' >> "$RESOLV"
+ echo "nameserver $DNS1 # profile $6" >> "$RESOLV"
+ if [ "$DNS2" ] ; then
+ echo '' >> "$RESOLV"
+ echo "nameserver $DNS2 # profile $6" >> "$RESOLV"
+ fi
+ fi
+ fi
+ ;;
+ D_*)
+ grep -v "profile $6" $RESOLV > /tmp/xx
+ mv /tmp/xx $RESOLV
+ ;;
+esac
+exit 0