-rwxr-xr-x | noncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS | 30 | ||||
-rwxr-xr-x | noncore/settings/networksettings2/etc_ppp/ip-up_down/U_Routes | 30 |
2 files changed, 60 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 diff --git a/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_Routes b/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_Routes new file mode 100755 index 0000000..afefc49 --- a/dev/null +++ b/noncore/settings/networksettings2/etc_ppp/ip-up_down/U_Routes @@ -0,0 +1,30 @@ +#!/bin/sh +exec 2> /tmp/ROUTE +set -x +CMD=`basename $0` +FIXED=/etc/ppp/$6.fixed + +case $CMD in + U_*) + if [ -f $FIXED ] + then + # ADD FIXED routes + grep "route add " $FIXED > /tmp/xx + fi + ;; + D_*) + if [ -f $FIXED ] + then + grep "route del " $FIXED > /tmp/xx + fi + ;; +esac + +if [ -f /tmp/xx ] +then + . /tmp/xx + rm /tmp/xx +fi + +exit 0 + |