From 9360cc798da32dfa0876d919b346faba671485cc Mon Sep 17 00:00:00 2001 From: sthen <> Date: Tue, 4 Aug 2009 15:16:45 +0000 Subject: [PATCH] Don't use grep/cut during shutdown, /usr might not be mounted. Spotted by deraadt@. These were used to bring down carp ifaces cleanly; replace with shell features. ok deraadt@, henning@. "Much mo' better" blambert@. --- src/etc/rc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/etc/rc b/src/etc/rc index 6f2a4b9d..78bce69a 100644 --- a/src/etc/rc +++ b/src/etc/rc @@ -1,4 +1,4 @@ -# $OpenBSD: rc,v 1.328 2009/06/30 15:30:24 deraadt Exp $ +# $OpenBSD: rc,v 1.329 2009/08/04 15:16:45 sthen Exp $ # System startup script run by init on autoboot # or after single-user. @@ -166,9 +166,10 @@ if [ X"$1" = X"shutdown" ]; then echo /etc/rc.shutdown complete. # bring carp interfaces down gracefully - ifconfig -a|grep '^carp.*:'|cut -f1 -d:|while read if - do - ifconfig $if down + ifconfig | while read if junk; do + case $if in + carp*:) ifconfig ${if%:} down ;; + esac done if [ X"${powerdown}" = X"YES" ]; then