summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2005-05-19 01:58:49 +0000
committermillert <millert@openbsd.org>2005-05-19 01:58:49 +0000
commit6be3177edb882d92d06e1bcf6fb8ec7a69f125dd (patch)
treecdbe8f31e9197678dc315b01a6442ca85012aca2
parentsync (diff)
downloadwireguard-openbsd-6be3177edb882d92d06e1bcf6fb8ec7a69f125dd.tar.xz
wireguard-openbsd-6be3177edb882d92d06e1bcf6fb8ec7a69f125dd.zip
o change wsconsctl.conf subshell into a function
o move test for foo.conf into the foo_conf function proper
-rw-r--r--etc/rc45
1 files changed, 24 insertions, 21 deletions
diff --git a/etc/rc b/etc/rc
index bfd4c1fbad0..6ad5c500543 100644
--- a/etc/rc
+++ b/etc/rc
@@ -1,4 +1,4 @@
-# $OpenBSD: rc,v 1.266 2005/05/18 16:43:51 millert Exp $
+# $OpenBSD: rc,v 1.267 2005/05/19 01:58:49 millert Exp $
# System startup script run by init on autoboot
# or after single-user.
@@ -52,6 +52,8 @@ update_limit() {
}
sysctl_conf() {
+ test -s /etc/sysctl.conf || return
+
# delete comments and blank lines
set -- `stripcom /etc/sysctl.conf`
while [ $# -ge 1 ] ; do
@@ -71,6 +73,8 @@ sysctl_conf() {
mixerctl_conf()
{
+ test -s /etc/mixerctl.conf || return
+
# delete comments and blank lines
set -- `stripcom /etc/mixerctl.conf`
while [ $# -ge 1 ] ; do
@@ -79,6 +83,22 @@ mixerctl_conf()
done
}
+wsconsctl_conf()
+{
+ local save_IFS="$IFS"
+
+ test -x /sbin/wsconsctl -a -s /etc/wsconsctl.conf || return
+ # delete comments and blank lines
+ IFS="
+"
+ set -- `stripcom /etc/wsconsctl.conf`
+ IFS="$save_IFS"
+ while [ $# -ge 1 ] ; do
+ eval /sbin/wsconsctl -w $1
+ shift
+ done
+}
+
# End subroutines
stty status '^T'
@@ -217,13 +237,9 @@ if [ X"${pf}" != X"NO" ]; then
echo $RULES | pfctl -f - -e
fi
-if [ -f /etc/sysctl.conf ]; then
- sysctl_conf
-fi
+sysctl_conf
-if [ -f /etc/mixerctl.conf ]; then
- mixerctl_conf
-fi
+mixerctl_conf
# set hostname, turn on network
echo 'starting network'
@@ -670,20 +686,7 @@ fi
echo '.'
-if [ -x /sbin/wsconsctl -a -f /etc/wsconsctl.conf ]; then
-(
- # delete comments and blank lines
- save_IFS="$IFS"
- IFS="
-"
- set -- `stripcom /etc/wsconsctl.conf`
- IFS="$save_IFS"
- while [ $# -ge 1 ] ; do
- eval /sbin/wsconsctl -w $1
- shift
- done
-)
-fi
+wsconsctl_conf
# KerberosV master KDC
if [ X"${krb5_master_kdc}" = X"YES" ]; then