summaryrefslogtreecommitdiff
path: root/etc/rc
diff options
context:
space:
mode:
authorRobert Peichaer <rpe@cvs.openbsd.org>2015-12-29 19:41:25 +0000
committerRobert Peichaer <rpe@cvs.openbsd.org>2015-12-29 19:41:25 +0000
commite160771f9e318b591a648562d20da0aef2ed39ce (patch)
tree9c51aadb691377a878a739e07f38eedb39701ba8 /etc/rc
parentbff95dd040bd2f9a673558148b3f64623a5ab270 (diff)
Replace single pattern case-blocks with simpler code.
OK halex@
Diffstat (limited to 'etc/rc')
-rw-r--r--etc/rc12
1 files changed, 4 insertions, 8 deletions
diff --git a/etc/rc b/etc/rc
index 541ff777547..0f1b9fa685a 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.473 2015/12/06 13:51:41 rpe Exp $
+# $OpenBSD: rc,v 1.474 2015/12/29 19:41:24 rpe Exp $
# System startup script run by init on autoboot or after single-user.
# Output and error are redirected to console by init, and the console is the
@@ -238,9 +238,7 @@ if [[ $1 == shutdown ]]; then
# Bring carp interfaces down gracefully.
ifconfig | while read _if _junk; do
- case $_if in
- carp+([0-9]):) ifconfig ${_if%:} down ;;
- esac
+ [[ $_if == carp+([0-9]): ]] && ifconfig ${_if%:} down
done
exit 0
@@ -293,14 +291,12 @@ if [[ $pf != NO ]]; then
fi
RULES="$RULES\npass in proto carp keep state (no-sync)"
RULES="$RULES\npass out proto carp !received-on any keep state (no-sync)"
- case $(sysctl vfs.mounts.nfs 2>/dev/null) in
- *[1-9]*)
+ if [[ $(sysctl vfs.mounts.nfs 2>/dev/null) == *[1-9]* ]]; then
# Don't kill NFS.
RULES="set reassemble yes no-df\n$RULES"
RULES="$RULES\npass in proto { tcp, udp } from any port { sunrpc, nfsd } to any"
RULES="$RULES\npass out proto { tcp, udp } from any to any port { sunrpc, nfsd } !received-on any"
- ;;
- esac
+ fi
print -- "$RULES" | pfctl -f -
pfctl -e
fi