diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-09-23 06:51:21 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 1998-09-23 06:51:21 +0000 |
commit | 2ca26d39dd4873726b8788e7905204655d152c9c (patch) | |
tree | a6bd61d81c3c2058b43c1df9e12fe7c39c760c0c | |
parent | cef6e7b22ebe551d17a51ef7971f7d812bbb73d6 (diff) |
if default route already set (dhcp?) use it. otherwise use /etc/mygate..
otherwise we have no default route... in any case, prompt.
-rw-r--r-- | distrib/miniroot/install.sh | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sh b/distrib/miniroot/install.sh index 26cb8350bd4..f80d16ceebf 100644 --- a/distrib/miniroot/install.sh +++ b/distrib/miniroot/install.sh @@ -1,5 +1,5 @@ #!/bin/sh -# $OpenBSD: install.sh,v 1.29 1998/09/17 00:49:15 deraadt Exp $ +# $OpenBSD: install.sh,v 1.30 1998/09/23 06:51:20 deraadt Exp $ # $NetBSD: install.sh,v 1.5.2.8 1996/08/27 18:15:05 gwr Exp $ # # Copyright (c) 1997,1998 Todd Miller, Theo de Raadt @@ -348,9 +348,16 @@ case "$resp" in configurenetwork - resp="none" - if [ -f /tmp/mygate ]; then - resp=`cat /tmp/mygate` + resp=`route -n show | + grep '^default' | + sed -e 's/^default //' -e 's/ .*//'` + if [ "X${resp}" = "X" ]; then + if [ -f /tmp/mygate ]; then + resp=`cat /etc/mygate` + if [ "X${resp}" = "X" ]; then + resp="none"; + fi + fi fi echo -n "Enter IP address of default route: [$resp] " getresp "$resp" |