amd revision 230099
1#!/bin/sh 2# 3# $FreeBSD: head/etc/rc.d/amd 230099 2012-01-14 02:18:41Z dougb $ 4# 5 6# PROVIDE: amd 7# REQUIRE: rpcbind ypset nfsclient cleanvar ldconfig 8# BEFORE: DAEMON 9# KEYWORD: nojail shutdown 10 11. /etc/rc.subr 12 13name="amd" 14rcvar="amd_enable" 15command="/usr/sbin/${name}" 16start_precmd="amd_precmd" 17command_args="&" 18extra_commands="reload" 19 20amd_precmd() 21{ 22 if ! checkyesno nfs_client_enable; then 23 force_depend nfsclient || return 1 24 fi 25 26 if ! checkyesno rpcbind_enable && \ 27 ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 28 then 29 force_depend rpcbind || return 1 30 fi 31 32 case ${amd_map_program} in 33 [Nn][Oo] | '') 34 ;; 35 *) 36 rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`" 37 ;; 38 esac 39 40 case "${amd_flags}" in 41 '') 42 if [ ! -r /etc/amd.conf ]; then 43 warn 'amd will not load without arguments' 44 return 1 45 fi 46 ;; 47 *) 48 rc_flags="-p ${rc_flags}" 49 command_args="> /var/run/amd.pid 2> /dev/null" 50 ;; 51 esac 52 return 0 53} 54 55load_rc_config $name 56run_rc_command "$1" 57