diff options
author | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-04-25 11:52:15 +0000 |
---|---|---|
committer | Kenneth R Westerback <krw@cvs.openbsd.org> | 2007-04-25 11:52:15 +0000 |
commit | 60b08424f5962c16449d90f93eb1a58222bf40da (patch) | |
tree | 4d149e0a46dfb3e6960c71bbc35bc22281f04d48 /distrib/miniroot/install.sub | |
parent | 957e5b5eecd3380646b20cfcfc9abf818156f676 (diff) |
Add capacity to specify one ntp 'server' (not 'servers') during install.
Suggested by deraadt@, nifty sed nit from ray@.
ok deraadt@ beck@ mbalmer@
Diffstat (limited to 'distrib/miniroot/install.sub')
-rw-r--r-- | distrib/miniroot/install.sub | 17 |
1 files changed, 13 insertions, 4 deletions
diff --git a/distrib/miniroot/install.sub b/distrib/miniroot/install.sub index 68d7b34c7a1..b7159c09b78 100644 --- a/distrib/miniroot/install.sub +++ b/distrib/miniroot/install.sub @@ -1,4 +1,4 @@ -# $OpenBSD: install.sub,v 1.415 2007/03/26 20:13:24 otto Exp $ +# $OpenBSD: install.sub,v 1.416 2007/04/25 11:52:14 krw Exp $ # $NetBSD: install.sub,v 1.5.2.8 1996/09/02 23:25:02 pk Exp $ # # Copyright (c) 1997-2007 Todd Miller, Theo de Raadt, Ken Westerback @@ -1536,10 +1536,19 @@ questions() { >>/mnt/etc/rc.conf.local fi - ask_yn "Start ntpd(8) by default?" - if [[ $resp == y ]]; then + ask "ntp server? (or 'none' or 'default')" none + if [[ $resp != none ]]; then echo "ntpd_flags= # enabled during install" \ - >>/mnt/etc/rc.conf.local + >>/mnt/etc/rc.conf.local + if [[ $resp != default ]]; then + # Comment out the default 'servers' line, and add a + # 'server' line with the first token in $resp as the + # server. + set -- $resp + sed -e "s/^servers /#&/;/#server /a\\ +server $1 +" /mnt/etc/ntpd.conf >/tmp/ntpd.conf + fi fi if [[ -n $MDXAPERTURE ]]; then |