diff options
author | Marc Espie <espie@cvs.openbsd.org> | 2007-04-25 14:12:06 +0000 |
---|---|---|
committer | Marc Espie <espie@cvs.openbsd.org> | 2007-04-25 14:12:06 +0000 |
commit | c6a59727baaa7d7cd13f8b1642136ca3d52885ec (patch) | |
tree | fb15542afa9b524b83cb45508c2eac60881fe43b /etc/rc | |
parent | 9e9ac7bf4e038f8d5745c979b40bc6490ffaf6a2 (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/rc | 14 |
1 files changed, 4 insertions, 10 deletions
@@ -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 |