2001-06-16 07:16:14 +00:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
2002-06-13 22:14:37 +00:00
|
|
|
# $NetBSD: amd,v 1.10 2002/04/29 12:08:17 lukem Exp $
|
|
|
|
# $FreeBSD$
|
2001-06-16 07:16:14 +00:00
|
|
|
#
|
|
|
|
|
|
|
|
# PROVIDE: amd
|
2002-06-13 22:14:37 +00:00
|
|
|
# REQUIRE: rpcbind mountall ypbind nfsclient
|
|
|
|
# BEFORE: DAEMON
|
|
|
|
# KEYWORD: FreeBSD NetBSD
|
2001-06-16 07:16:14 +00:00
|
|
|
|
|
|
|
. /etc/rc.subr
|
|
|
|
|
|
|
|
name="amd"
|
2002-06-13 22:14:37 +00:00
|
|
|
rcvar=`set_rcvar`
|
2002-06-21 19:50:01 +00:00
|
|
|
command="/usr/sbin/${name}"
|
2002-06-13 22:14:37 +00:00
|
|
|
|
2002-09-06 16:18:05 +00:00
|
|
|
case ${OSTYPE} in
|
2002-06-13 22:14:37 +00:00
|
|
|
FreeBSD)
|
|
|
|
start_precmd="amd_precmd"
|
2002-06-24 19:50:56 +00:00
|
|
|
command_args="&"
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
NetBSD)
|
|
|
|
command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid'
|
|
|
|
required_dirs="$amd_dir"
|
|
|
|
required_files="/etc/amd.conf"
|
|
|
|
required_vars="rpcbind"
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
2002-10-12 10:31:31 +00:00
|
|
|
amd_precmd()
|
2002-06-13 22:14:37 +00:00
|
|
|
{
|
2002-09-06 16:18:05 +00:00
|
|
|
case ${OSTYPE} in
|
2002-06-13 22:14:37 +00:00
|
|
|
FreeBSD)
|
2002-10-12 10:31:31 +00:00
|
|
|
if ! checkyesno nfs_client_enable; then
|
2002-06-13 22:14:37 +00:00
|
|
|
force_depend nfsclient || return 1
|
|
|
|
fi
|
2002-06-20 08:49:44 +00:00
|
|
|
|
2002-08-14 05:44:32 +00:00
|
|
|
if ! checkyesno rpcbind_enable && \
|
2002-06-21 19:50:01 +00:00
|
|
|
! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1
|
2002-10-12 10:31:31 +00:00
|
|
|
then
|
2002-06-13 22:14:37 +00:00
|
|
|
force_depend rpcbind || return 1
|
|
|
|
fi
|
2001-06-16 07:16:14 +00:00
|
|
|
|
2002-06-13 22:14:37 +00:00
|
|
|
case ${amd_map_program} in
|
|
|
|
[Nn][Oo] | '')
|
|
|
|
;;
|
|
|
|
*)
|
2002-09-18 08:49:50 +00:00
|
|
|
rc_flags="${rc_flags} `eval ${amd_map_program}`"
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
2001-06-16 07:16:14 +00:00
|
|
|
|
2002-06-13 22:14:37 +00:00
|
|
|
case "${amd_flags}" in
|
|
|
|
'')
|
|
|
|
if [ ! -r /etc/amd.conf ]; then
|
|
|
|
warn 'amd will not load without arguments'
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
;;
|
|
|
|
*)
|
2002-09-18 08:49:50 +00:00
|
|
|
rc_flags="-p ${rc_flags} > /var/run/amd.pid 2> /dev/null" \
|
2002-06-13 22:14:37 +00:00
|
|
|
;;
|
|
|
|
esac
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
return 0
|
|
|
|
}
|
|
|
|
|
|
|
|
load_rc_config $name
|
2001-06-16 07:16:14 +00:00
|
|
|
run_rc_command "$1"
|