#!/bin/ksh
#
-# $OpenBSD: amd,v 1.8 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: amd,v 1.9 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/amd"
rc_stop=NO
rc_pre() {
- [ -e ${amd_master} ] || return 1
+ [[ -e ${amd_master} ]] || return 1
daemon_flags="${daemon_flags} $(print -rn -- $(< ${amd_master}))"
}
#!/bin/ksh
#
-# $OpenBSD: bootparamd,v 1.3 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: bootparamd,v 1.4 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/rpc.bootparamd"
rc_reload=NO
rc_pre() {
- [ -s /etc/bootparams ]
+ [[ -s /etc/bootparams ]]
}
rc_cmd $1
#!/bin/ksh
#
-# $OpenBSD: iked,v 1.4 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: iked,v 1.5 2018/01/11 21:09:26 rpe Exp $
daemon="/sbin/iked"
pexp="iked: parent.*"
rc_pre() {
- [ X"${sasyncd_flags}" != X"NO" ] && \
+ [[ ${sasyncd_flags} != NO ]] &&
daemon_flags="-S ${daemon_flags}"
#return 0
# child will not return a config parsing error to the parent
#!/bin/ksh
#
-# $OpenBSD: isakmpd,v 1.2 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: isakmpd,v 1.3 2018/01/11 21:09:26 rpe Exp $
daemon="/sbin/isakmpd"
pexp="isakmpd: monitor \[priv\]"
rc_pre() {
- [ X"${sasyncd_flags}" != X"NO" ] && \
+ [[ ${sasyncd_flags} != NO ]] &&
daemon_flags="-S ${daemon_flags}"
return 0
}
#!/bin/ksh
#
-# $OpenBSD: ldattach,v 1.3 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: ldattach,v 1.4 2018/01/11 21:09:26 rpe Exp $
daemon="/sbin/ldattach"
rc_reload=NO
rc_pre() {
- [ -n "${ldattach_flags}" ]
+ [[ -n ${ldattach_flags} ]]
}
rc_cmd $1
#!/bin/ksh
#
-# $OpenBSD: mopd,v 1.4 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: mopd,v 1.5 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/mopd"
daemon_flags="-a"
rc_reload=NO
rc_pre() {
- [ -d /tftpboot/mop ]
+ [[ -d /tftpboot/mop ]]
}
rc_cmd $1
#!/bin/ksh
#
-# $OpenBSD: mountd,v 1.7 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: mountd,v 1.8 2018/01/11 21:09:26 rpe Exp $
daemon="/sbin/mountd"
rc_stop=NO
rc_pre() {
- [ -s /etc/exports ] && grep -qv '^#' /etc/exports && \
- rm -f /var/db/mountdtab && \
+ [[ -s /etc/exports ]] && grep -qv '^#' /etc/exports &&
+ rm -f /var/db/mountdtab &&
echo -n > /var/db/mountdtab
}
#!/bin/ksh
#
-# $OpenBSD: nfsd,v 1.7 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: nfsd,v 1.8 2018/01/11 21:09:26 rpe Exp $
daemon="/sbin/nfsd"
daemon_flags="-tun 4"
rc_reload=NO
rc_pre() {
- [ -s /etc/exports ] && grep -qv '^#' /etc/exports
+ [[ -s /etc/exports ]] && grep -qv '^#' /etc/exports
}
rc_cmd $1
#!/bin/ksh
#
-# $OpenBSD: rarpd,v 1.4 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: rarpd,v 1.5 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/rarpd"
daemon_flags="-a"
rc_reload=NO
rc_pre() {
- [ -s /etc/ethers ]
+ [[ -s /etc/ethers ]]
}
rc_cmd $1
#!/bin/ksh
#
-# $OpenBSD: spamd,v 1.9 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: spamd,v 1.10 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/libexec/spamd"
rc_reload=NO
rc_pre() {
- if [ X"${spamd_black}" != X"NO" ]; then
+ if [[ ${spamd_black} != NO ]]; then
daemon_flags="-b ${daemon_flags}"
spamd_setup_flags="-b"
fi
#!/bin/ksh
#
-# $OpenBSD: spamlogd,v 1.3 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: spamlogd,v 1.4 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/libexec/spamlogd"
rc_reload=NO
rc_pre() {
- [ X"${spamd_flags}" != X"NO" -a X"${spamd_black}" = X"NO" ]
+ [[ ${spamd_flags} != NO && ${spamd_black} == NO ]]
if pfctl -si | grep -q Enabled; then
ifconfig pflog0 create
if ifconfig pflog0; then
#!/bin/ksh
#
-# $OpenBSD: unbound,v 1.4 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: unbound,v 1.5 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/unbound"
daemon_flags="-c /var/unbound/etc/unbound.conf"
}
rc_start() {
- /usr/sbin/unbound-checkconf > /dev/null && \
+ /usr/sbin/unbound-checkconf > /dev/null &&
${rcexec} "unbound ${daemon_flags}"
}
#!/bin/ksh
#
-# $OpenBSD: ypbind,v 1.8 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: ypbind,v 1.9 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/ypbind"
rc_reload=NO
rc_pre() {
- [ X"`domainname`" != X"" ]
+ [[ -n $(domainname) ]]
}
rc_post() {
#!/bin/ksh
#
-# $OpenBSD: yppasswdd,v 1.5 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: yppasswdd,v 1.6 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/rpc.yppasswdd"
rc_reload=NO
rc_pre() {
- [ X"`domainname`" != X"" -a -d /var/yp/`domainname` ] || \
+ [[ -n $(domainname) && -d /var/yp/$(domainname) ]] ||
return 1
- _host1=`ypwhich -m passwd 2> /dev/null`
- _host2=`hostname`
- if [ `grep '^lookup' /etc/resolv.conf | grep yp | wc -c` -ne 0 ]; then
- _host1=`ypmatch $_host1 hosts | cut -d' ' -f2`
- _host2=`ypmatch $_host2 hosts | cut -d' ' -f2 | head -1`
+ _host1=$(ypwhich -m passwd 2> /dev/null)
+ _host2=$(hostname)
+ if [[ $(grep '^lookup' /etc/resolv.conf | grep yp | wc -c) -ne 0 ]]; then
+ _host1=$(ypmatch $_host1 hosts | cut -d' ' -f2)
+ _host2=$(ypmatch $_host2 hosts | cut -d' ' -f2 | head -1)
else
- _host1=`echo $_host1 | nslookup | grep '^Name: ' | \
- sed -e 's/^Name: //'`
- _host2=`echo $_host2 | nslookup | grep '^Name: ' | \
- sed -e 's/^Name: //'`
+ _host1=$(echo $_host1 | nslookup | grep '^Name: ' |
+ sed -e 's/^Name: //')
+ _host2=$(echo $_host2 | nslookup | grep '^Name: ' |
+ sed -e 's/^Name: //')
fi
- [ "$_host2" = "$_host1" ]
+ [[ $_host2 == $_host1 ]]
}
rc_cmd $1
#!/bin/ksh
#
-# $OpenBSD: ypserv,v 1.5 2018/01/11 19:52:12 rpe Exp $
+# $OpenBSD: ypserv,v 1.6 2018/01/11 21:09:26 rpe Exp $
daemon="/usr/sbin/ypserv"
. /etc/rc.d/rc.subr
rc_pre() {
- [ X"`domainname`" != X"" -a -d /var/yp/`domainname` ]
+ [[ -n $(domainname) && -d /var/yp/$(domainname) ]]
}
rc_cmd $1