summaryrefslogtreecommitdiff
path: root/etc/rc
diff options
context:
space:
mode:
authorMarc Espie <espie@cvs.openbsd.org>2007-04-25 14:12:06 +0000
committerMarc Espie <espie@cvs.openbsd.org>2007-04-25 14:12:06 +0000
commitc6a59727baaa7d7cd13f8b1642136ca3d52885ec (patch)
treefb15542afa9b524b83cb45508c2eac60881fe43b /etc/rc
parent9e9ac7bf4e038f8d5745c979b40bc6490ffaf6a2 (diff)
shutdown existing carp interfaces based on ifconfig output, not static
/etc/*.if files. okay reyk@, deraadt@, krw@...
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc14
1 files changed, 4 insertions, 10 deletions
diff --git a/etc/rc b/etc/rc
index 07bc19b6c05..c1342186dee 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.303 2007/04/14 11:54:00 grunk Exp $
+# $OpenBSD: rc,v 1.304 2007/04/25 14:12:05 espie Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -121,15 +121,9 @@ if [ X"$1" = X"shutdown" ]; then
echo /etc/rc.shutdown complete.
# bring carp interfaces down gracefully
- for hn in /etc/hostname.carp[0-9]*; do
- # Strip off /etc/hostname. prefix
- if=${hn#/etc/hostname.}
- test "$if" = "carp[0-9]*" && continue
-
- ifconfig $if > /dev/null 2>&1
- if [ $? -eq 0 ]; then
- ifconfig $if down
- fi
+ ifconfig -a|grep '^carp.*:'|cut -f1 -d:|while read if
+ do
+ ifconfig $if down
done
if [ X"${powerdown}" = X"YES" ]; then