Browse Source

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)
OPENBSD_3_8
deraadt 20 years ago
parent
commit
bd9da8ca6c
1 changed files with 3 additions and 2 deletions
  1. +3
    -2
      src/etc/netstart

+ 3
- 2
src/etc/netstart View File

@ -1,6 +1,6 @@
#!/bin/sh - #!/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) # Strip comments (and leading/trailing whitespace if IFS is set)
# from a file and spew to stdout # from a file and spew to stdout
@ -83,6 +83,7 @@ ifstart() {
[ "$bcaddr" = "NONE" ] && bcaddr= [ "$bcaddr" = "NONE" ] && bcaddr=
ifconfig $if $name $mask $bcaddr $ext1 $ext2 down ifconfig $if $name $mask $bcaddr $ext1 $ext2 down
cmd="dhclient $if" cmd="dhclient $if"
setgateway=N
;; ;;
"rtsol") "rtsol")
ifconfig $if $name $mask $bcaddr $ext1 $ext2 up 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 # /etc/mygate, if it exists, contains the name of my gateway host
# that name must be in /etc/hosts. # 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 delete default > /dev/null 2>&1
route -qn add -host default `stripcom /etc/mygate` route -qn add -host default `stripcom /etc/mygate`
fi fi


Loading…
Cancel
Save