summaryrefslogtreecommitdiff
path: root/noncore
authorwimpie <wimpie>2005-01-04 01:41:58 (UTC)
committer wimpie <wimpie>2005-01-04 01:41:58 (UTC)
commite2094d408c9102f8866aafbe725a65f25fdef063 (patch) (side-by-side diff)
treedaf1e8c3ea18ff8ad55a80a16440fbe422698479 /noncore
parent2a7afda8b7daf4a43e370dba09e43e7f5058ab49 (diff)
downloadopie-e2094d408c9102f8866aafbe725a65f25fdef063.zip
opie-e2094d408c9102f8866aafbe725a65f25fdef063.tar.gz
opie-e2094d408c9102f8866aafbe725a65f25fdef063.tar.bz2
Scripts to manage routes and DNS information for ppp
Diffstat (limited to 'noncore') (more/less context) (ignore whitespace changes)
-rwxr-xr-xnoncore/settings/networksettings2/etc_ppp/ip-up_down/U_DNS30
-rwxr-xr-xnoncore/settings/networksettings2/etc_ppp/ip-up_down/U_Routes30
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
+