summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-03 19:39:32 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>2005-04-03 19:39:32 +0000
commit4f93a7acad22f9b4279bc5db1a721e758a10beda (patch)
treeb44cdb2b86a7d99fd53dc71a046cf71c2cd05879
parent677c18cc7dd621a4c552d67a1ba2d8751a515bde (diff)
if dhcp is used to get an address on any interface, ignore /etc/mygate
ok krw (this lets us do something rather cool with the zaurus in particular)
-rw-r--r--etc/netstart5
1 files changed, 3 insertions, 2 deletions
diff --git a/etc/netstart b/etc/netstart
index 08938d14e70..4124431ef2a 100644
--- a/etc/netstart
+++ b/etc/netstart
@@ -1,6 +1,6 @@
#!/bin/sh -
#
-# $OpenBSD: netstart,v 1.102 2005/01/04 15:40:53 mcbride Exp $
+# $OpenBSD: netstart,v 1.103 2005/04/03 19:39:31 deraadt Exp $
# Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout
@@ -83,6 +83,7 @@ ifstart() {
[ "$bcaddr" = "NONE" ] && bcaddr=
ifconfig $if $name $mask $bcaddr $ext1 $ext2 down
cmd="dhclient $if"
+ setgateway=N
;;
"rtsol")
ifconfig $if $name $mask $bcaddr $ext1 $ext2 up
@@ -320,7 +321,7 @@ done
# /etc/mygate, if it exists, contains the name of my gateway host
# that name must be in /etc/hosts.
-if [ -f /etc/mygate ]; then
+if [ "X${setgateway} != X"N" -a -f /etc/mygate ]; then
route -qn delete default > /dev/null 2>&1
route -qn add -host default `stripcom /etc/mygate`
fi