From e2094d408c9102f8866aafbe725a65f25fdef063 Mon Sep 17 00:00:00 2001 From: wimpie Date: Tue, 04 Jan 2005 01:41:58 +0000 Subject: Scripts to manage routes and DNS information for ppp --- (limited to 'noncore') 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 + -- cgit v0.9.0.2