Convert from ${CMD_OSTYPE}
to ${OSTYPE}. This saves a shell invocation on
OS-dependent case switches.
This commit is contained in:
parent
550f8fc46b
commit
77e55efba0
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=103019
@ -20,7 +20,7 @@ stop_cmd="accounting_stop"
|
||||
|
||||
accounting_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
_dir=`dirname "$accounting_file"`
|
||||
if [ ! -d `dirname "$_dir"` ]; then
|
||||
|
@ -15,7 +15,7 @@ name="amd"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_precmd="amd_precmd"
|
||||
command_args="&"
|
||||
@ -30,7 +30,7 @@ esac
|
||||
|
||||
amd_precmd()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
if ! checkyesno nfs_client_enable ; then
|
||||
force_depend nfsclient || return 1
|
||||
|
@ -15,7 +15,7 @@ name="apmd"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_precmd="apmd_prestart"
|
||||
;;
|
||||
|
@ -15,7 +15,7 @@ name="bootparamd"
|
||||
rcvar=`set_rcvar`
|
||||
required_files="/etc/bootparams"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
command="/usr/sbin/${name}"
|
||||
;;
|
||||
|
@ -28,7 +28,7 @@ cleartmp_start()
|
||||
find -x . ! -name . ! -name lost+found ! -name quota.user \
|
||||
! -name quota.group -exec rm -rf -- {} \; -type d -prune)
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# Remove X lock files, since they will prevent you from
|
||||
# restarting X
|
||||
|
@ -34,7 +34,7 @@ fsck_start()
|
||||
trap : 3
|
||||
|
||||
echo "Starting file system checks:"
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
if checkyesno background_fsck; then
|
||||
fsck -F -p
|
||||
@ -60,7 +60,7 @@ fsck_start()
|
||||
stop_boot
|
||||
;;
|
||||
8)
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
if checkyesno fsck_y_enable; then
|
||||
echo "File system preen failed, trying fsck -y."
|
||||
|
@ -14,7 +14,7 @@ name="ipfilter"
|
||||
rcvar=`set_rcvar`
|
||||
load_rc_config $name
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
stop_precmd="test -f ${ipfilter_rules}"
|
||||
;;
|
||||
@ -36,7 +36,7 @@ extra_commands="reload resync status"
|
||||
|
||||
ipfilter_prestart()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# load ipfilter kernel module if needed
|
||||
if ! sysctl net.inet.ipf.fr_pass > /dev/null 2>&1; then
|
||||
@ -76,7 +76,7 @@ esac
|
||||
ipfilter_start()
|
||||
{
|
||||
echo "Enabling ipfilter."
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
${ipfilter_program:-/sbin/ipf} -Fa -f \
|
||||
"${ipfilter_rules}" ${ipfilter_flags}
|
||||
@ -95,7 +95,7 @@ ipfilter_start()
|
||||
|
||||
ipfilter_stop()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
echo "Saving firewall state tables"
|
||||
${ipfs_program:-/sbin/ipfs} -W ${ipfs_flags}
|
||||
@ -112,7 +112,7 @@ ipfilter_reload()
|
||||
{
|
||||
echo "Reloading ipfilter rules."
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
${ipfilter_program:-/sbin/ipf} -I -Fa -f \
|
||||
"${ipfilter_rules}" ${ipfilter_flags}
|
||||
@ -136,7 +136,7 @@ ipfilter_reload()
|
||||
|
||||
ipfilter_resync()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# Don't resync if ipfilter is not loaded
|
||||
[ sysctl net.inet.ipf.fr_pass > /dev/null 2>&1 ] && return
|
||||
|
@ -14,7 +14,7 @@
|
||||
name="ipmon"
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
command="/sbin/ipmon"
|
||||
start_precmd="ipmon_precmd"
|
||||
|
@ -14,7 +14,7 @@
|
||||
name="ipnat"
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
IPNATDIR="/sbin"
|
||||
start_precmd="ipnat_precmd"
|
||||
@ -44,7 +44,7 @@ ipnat_precmd()
|
||||
|
||||
ipnat_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
echo -n 'Installing NAT rules ... '
|
||||
if [ -r "${ipnat_rules}" ]; then
|
||||
|
@ -24,7 +24,7 @@ stop_cmd="ipsec_stop"
|
||||
reload_cmd="ipsec_reload"
|
||||
extra_commands="reload"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
ipsec_program="/usr/sbin/setkey"
|
||||
;;
|
||||
|
@ -17,7 +17,7 @@ name="isdnd"
|
||||
rcvar=`set_rcvar isdn`
|
||||
pidfile="/var/run/${name}.pid"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_cmd="isdnd_start"
|
||||
;;
|
||||
|
@ -18,7 +18,7 @@ stop_cmd=":"
|
||||
|
||||
ldconfig_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
ldconfig=${ldconfig_command}
|
||||
checkyesno ldconfig_insecure && ldconfig="${ldconfig} -i"
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
arg=$1
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
RCVAR_SERVER="nfs_server_enable"
|
||||
RCVAR_CLIENT="nfs_client_enable"
|
||||
|
@ -16,7 +16,7 @@ rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
required_files="/etc/printcap"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
NetBSD)
|
||||
pidfile="/var/run/${name}.pid"
|
||||
;;
|
||||
|
@ -16,7 +16,7 @@ rcvar="update_motd"
|
||||
start_cmd="motd_start"
|
||||
stop_cmd=":"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
T=`mktemp /tmp/_motd.XXXXXX`
|
||||
PERMS="644"
|
||||
@ -38,7 +38,7 @@ motd_start()
|
||||
install -c -o root -g wheel -m ${PERMS} /dev/null /etc/motd
|
||||
fi
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
uname -v | sed -e 's,^\([^#]*\) #\(.* [1-2][0-9][0-9][0-9]\).*/\([^\]*\) $,\1 (\3) #\2,' > ${T}
|
||||
awk '{if (NR == 1) {if ($1 == "FreeBSD") {next} else {print "\n"$0}} else {print}}' < /etc/motd >> ${T}
|
||||
|
@ -16,7 +16,7 @@ stop_cmd=":"
|
||||
|
||||
mountcritlocal_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# Set up the list of network filesystem types for which mounting
|
||||
# should be delayed until after network initialization.
|
||||
|
@ -13,7 +13,7 @@
|
||||
name="mountcritremote"
|
||||
stop_cmd=":"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_cmd="mountcritremote_start"
|
||||
start_precmd="mountcritremote_precmd"
|
||||
@ -47,7 +47,7 @@ mountcritremote_precmd()
|
||||
|
||||
mountcritremote_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# Mount nfs filesystems.
|
||||
#
|
||||
|
@ -19,7 +19,7 @@ extra_commands="reload"
|
||||
|
||||
mountd_precmd()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
|
@ -13,7 +13,7 @@
|
||||
name=moused
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_cmd="moused_start"
|
||||
;;
|
||||
|
@ -19,7 +19,7 @@ start_precmd="named_precmd"
|
||||
required_dirs="$named_chrootdir" # if it is set, it must exist
|
||||
extra_commands="reload"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
nuser=bind
|
||||
ngroup=bind
|
||||
@ -79,7 +79,7 @@ make_symlinks()
|
||||
|
||||
named_precmd()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
! checkyesno named_rcng && return 0
|
||||
# Is the user using a sandbox?
|
||||
@ -96,7 +96,7 @@ named_precmd()
|
||||
;;
|
||||
esac
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# Make the symlinks only if the user wants them done.
|
||||
checkyesno named_symlink_enable && make_symlinks
|
||||
@ -108,7 +108,7 @@ named_precmd()
|
||||
|
||||
# Change run_rc_commands()'s internal copy of $named_flags
|
||||
#
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
! checkyesno named_rcng && return
|
||||
;;
|
||||
|
@ -14,7 +14,7 @@ name="nfsd"
|
||||
rcvar=`set_rcvar nfs_server`
|
||||
command="/usr/sbin/${name}"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
command_args="${nfs_server_flags}"
|
||||
start_precmd="nfsd_precmd"
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
arg=$1
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
RCVAR_SERVER="nfs_server_enable"
|
||||
RCVAR_CLIENT="nfs_client_enable"
|
||||
|
@ -17,7 +17,7 @@ command="/usr/sbin/${name}"
|
||||
pidfile="/var/run/${name}.pid"
|
||||
required_files="/etc/ntp.conf"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
NetBSD)
|
||||
start_precmd="ntpd_precmd"
|
||||
;;
|
||||
|
@ -13,7 +13,7 @@
|
||||
name="ntpdate"
|
||||
rcvar=`set_rcvar`
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
command="/usr/sbin/${name}"
|
||||
command_args=">/dev/null 2>&1"
|
||||
|
@ -16,7 +16,7 @@ stop_cmd=":"
|
||||
|
||||
root_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# root normally must be read/write, but if this is a BOOTP NFS
|
||||
# diskless boot it does not have to be.
|
||||
|
@ -20,7 +20,7 @@ name="route6d"
|
||||
#
|
||||
load_rc_config $name
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
rcvar="ipv6_router_enable"
|
||||
command="${ipv6_router:-/usr/sbin/${name}}"
|
||||
|
@ -19,7 +19,7 @@ name="routed"
|
||||
#
|
||||
load_rc_config $name
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
rcvar="router_enable"
|
||||
command="${router:-/sbin/${name}}"
|
||||
|
@ -14,7 +14,7 @@ name="rpcbind"
|
||||
rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
NetBSD)
|
||||
pidfile="/var/run/${name}.pid"
|
||||
;;
|
||||
|
@ -16,7 +16,7 @@ rcvar=`set_rcvar`
|
||||
command="/usr/sbin/${name}"
|
||||
start_precmd="rtadvd_precmd"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
IS_GATEWAY="checkyesno ipv6_gateway_enable"
|
||||
;;
|
||||
@ -46,7 +46,7 @@ rtadvd_precmd()
|
||||
# from another machine, so if you enable this, do it with
|
||||
# enough care.)
|
||||
#
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# If specific interfaces haven't been specified,
|
||||
# get a list of interfaces and enable it on them
|
||||
|
@ -16,7 +16,7 @@ start_cmd="savecore_start"
|
||||
start_precmd="savecore_prestart"
|
||||
stop_cmd=":"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
NetBSD)
|
||||
rcvar=$name
|
||||
;;
|
||||
@ -29,7 +29,7 @@ savecore_prestart()
|
||||
#
|
||||
DUMPDIR="${dumpdir:-/var/crash}"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
# Quit if we have no dump device
|
||||
case ${dumpdev} in
|
||||
|
@ -17,7 +17,7 @@ stop_cmd=":"
|
||||
|
||||
securelevel_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
case ${kern_securelevel_enable} in
|
||||
[Yy][Ee][Ss])
|
||||
|
@ -19,7 +19,7 @@ name="sendmail"
|
||||
rcvar=`set_rcvar`
|
||||
required_files="/etc/mail/${name}.cf"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
command=${sendmail_program:-/usr/sbin/sendmail}
|
||||
pidfile=${sendmail_pidfile:-/var/run/sendmail.pid}
|
||||
@ -83,7 +83,7 @@ sendmail_precmd()
|
||||
|
||||
run_rc_command "$1"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
required_files=
|
||||
|
||||
|
@ -13,7 +13,7 @@
|
||||
|
||||
arg=$1
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
RCVAR_SERVER="nfs_server_enable"
|
||||
RCVAR_CLIENT="nfs_client_enable"
|
||||
|
@ -12,7 +12,7 @@
|
||||
|
||||
name="swap1"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_cmd='swapon -a'
|
||||
stop_cmd=':'
|
||||
|
@ -14,7 +14,7 @@
|
||||
name="sysctl"
|
||||
stop_cmd=":"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_cmd="FreeBSD_start"
|
||||
extra_commands="reload lastload"
|
||||
|
@ -20,7 +20,7 @@ extra_commands="reload"
|
||||
|
||||
_sockfile="/var/run/syslogd.sockets"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
pidfile="/var/run/syslog.pid"
|
||||
evalargs="rc_flags=\"\`set_socketlist\` \$rc_flags\""
|
||||
|
@ -16,7 +16,7 @@ stop_cmd=":"
|
||||
|
||||
ttyflags_start()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
|
||||
# Whack the pty perms back into shape.
|
||||
|
@ -16,7 +16,7 @@
|
||||
name="virecover"
|
||||
stop_cmd=":"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
start_cmd="virecover_start"
|
||||
;;
|
||||
|
@ -15,7 +15,7 @@ name="ypbind"
|
||||
command="/usr/sbin/${name}"
|
||||
start_precmd="ypbind_precmd"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
rcvar="nis_client_enable"
|
||||
command_args="${nis_client_flags}"
|
||||
|
@ -15,7 +15,7 @@ name="yppasswdd"
|
||||
command="/usr/sbin/rpc.{name}"
|
||||
start_precmd="yppasswdd_precmd"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
rcvar="nis_yppasswdd_enable"
|
||||
command_args="${nis_yppasswdd_flags}"
|
||||
@ -28,7 +28,7 @@ esac
|
||||
|
||||
yppasswdd_precmd()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
|
@ -14,7 +14,7 @@ name="ypserv"
|
||||
command="/usr/sbin/${name}"
|
||||
start_precmd="ypserv_precmd"
|
||||
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
rcvar="nis_server_enable"
|
||||
command_args="${nis_server_flags}"
|
||||
@ -27,7 +27,7 @@ esac
|
||||
|
||||
ypserv_precmd()
|
||||
{
|
||||
case `${CMD_OSTYPE}` in
|
||||
case ${OSTYPE} in
|
||||
FreeBSD)
|
||||
if ! checkyesno rpcbind_enable && \
|
||||
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
||||
|
Loading…
Reference in New Issue
Block a user