author | wimpie <wimpie> | 2005-01-04 01:41:58 (UTC) |
---|---|---|
committer | wimpie <wimpie> | 2005-01-04 01:41:58 (UTC) |
commit | e2094d408c9102f8866aafbe725a65f25fdef063 (patch) (unidiff) | |
tree | daf1e8c3ea18ff8ad55a80a16440fbe422698479 /noncore/settings/networksettings2/etc_ppp | |
parent | 2a7afda8b7daf4a43e370dba09e43e7f5058ab49 (diff) | |
download | opie-e2094d408c9102f8866aafbe725a65f25fdef063.zip opie-e2094d408c9102f8866aafbe725a65f25fdef063.tar.gz opie-e2094d408c9102f8866aafbe725a65f25fdef063.tar.bz2 |
Scripts to manage routes and DNS information for ppp
Diffstat (limited to 'noncore/settings/networksettings2/etc_ppp') (more/less context) (show whitespace changes)
-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 @@ | |||
1 | #!/bin/sh | ||
2 | exec 2> /tmp/RES | ||
3 | set -x | ||
4 | CMD=`basename $0` | ||
5 | RESOLV=/etc/resolv.conf | ||
6 | FIXED=/etc/ppp/$6.fixed | ||
7 | |||
8 | case $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 | ;; | ||
29 | esac | ||
30 | 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 @@ | |||
1 | #!/bin/sh | ||
2 | exec 2> /tmp/ROUTE | ||
3 | set -x | ||
4 | CMD=`basename $0` | ||
5 | FIXED=/etc/ppp/$6.fixed | ||
6 | |||
7 | case $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 | ;; | ||
21 | esac | ||
22 | |||
23 | if [ -f /tmp/xx ] | ||
24 | then | ||
25 | . /tmp/xx | ||
26 | rm /tmp/xx | ||
27 | fi | ||
28 | |||
29 | exit 0 | ||
30 | |||