summaryrefslogtreecommitdiff
authorwimpie <wimpie>2005-01-04 01:41:58 (UTC)
committer wimpie <wimpie>2005-01-04 01:41:58 (UTC)
commite2094d408c9102f8866aafbe725a65f25fdef063 (patch) (unidiff)
treedaf1e8c3ea18ff8ad55a80a16440fbe422698479
parent2a7afda8b7daf4a43e370dba09e43e7f5058ab49 (diff)
downloadopie-e2094d408c9102f8866aafbe725a65f25fdef063.zip
opie-e2094d408c9102f8866aafbe725a65f25fdef063.tar.gz
opie-e2094d408c9102f8866aafbe725a65f25fdef063.tar.bz2
Scripts to manage routes and DNS information for ppp
Diffstat (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 @@
1#!/bin/sh
2exec 2> /tmp/RES
3set -x
4CMD=`basename $0`
5RESOLV=/etc/resolv.conf
6FIXED=/etc/ppp/$6.fixed
7
8case $CMD in
9 U_*)
10 if [ -f $FIXED ]
11 then
12 # ADD FIXED dns ENTRIES
13 grep "nameserver " $FIXED >> "$RESOLV"
14 else
15 if [ "$DNS1" ] ; then
16 echo '' >> "$RESOLV"
17 echo "nameserver $DNS1 # profile $6" >> "$RESOLV"
18 if [ "$DNS2" ] ; then
19 echo '' >> "$RESOLV"
20 echo "nameserver $DNS2 # profile $6" >> "$RESOLV"
21 fi
22 fi
23 fi
24 ;;
25 D_*)
26 grep -v "profile $6" $RESOLV > /tmp/xx
27 mv /tmp/xx $RESOLV
28 ;;
29esac
30exit 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 @@
1#!/bin/sh
2exec 2> /tmp/ROUTE
3set -x
4CMD=`basename $0`
5FIXED=/etc/ppp/$6.fixed
6
7case $CMD in
8 U_*)
9 if [ -f $FIXED ]
10 then
11 # ADD FIXED routes
12 grep "route add " $FIXED > /tmp/xx
13 fi
14 ;;
15 D_*)
16 if [ -f $FIXED ]
17 then
18 grep "route del " $FIXED > /tmp/xx
19 fi
20 ;;
21esac
22
23if [ -f /tmp/xx ]
24then
25 . /tmp/xx
26 rm /tmp/xx
27fi
28
29exit 0
30