amd revision 193197
193250Sphk#!/bin/sh 293250Sphk# 393250Sphk# $FreeBSD: head/etc/rc.d/amd 193197 2009-06-01 04:55:13Z dougb $ 493250Sphk# 593250Sphk 693250Sphk# PROVIDE: amd 793250Sphk# REQUIRE: rpcbind ypset nfsclient cleanvar ldconfig 893250Sphk# BEFORE: DAEMON 993250Sphk# KEYWORD: nojail shutdown 1093250Sphk 1193250Sphk. /etc/rc.subr 1293250Sphk 1393250Sphkname="amd" 1493250Sphkrcvar=`set_rcvar` 1593250Sphkcommand="/usr/sbin/${name}" 1693250Sphkstart_precmd="amd_precmd" 1793250Sphkcommand_args="&" 1893250Sphkextra_commands="reload" 1993250Sphk 2093250Sphkamd_precmd() 2193250Sphk{ 2293250Sphk if ! checkyesno nfs_client_enable; then 2393250Sphk force_depend nfsclient || return 1 2493250Sphk fi 2593250Sphk 2693250Sphk if ! checkyesno rpcbind_enable && \ 2793250Sphk ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 2893250Sphk then 2993250Sphk force_depend rpcbind || return 1 3093250Sphk fi 3193250Sphk 3293250Sphk case ${amd_map_program} in 3393250Sphk [Nn][Oo] | '') 3493250Sphk ;; 3593250Sphk *) 3693250Sphk rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`" 3793250Sphk ;; 3893250Sphk esac 3993250Sphk 4093250Sphk case "${amd_flags}" in 4193250Sphk '') 4293250Sphk if [ ! -r /etc/amd.conf ]; then 43110523Sphk warn 'amd will not load without arguments' 4493250Sphk return 1 45104191Sphk fi 46104191Sphk ;; 47104191Sphk *) 48104191Sphk rc_flags="-p ${rc_flags}" 4993250Sphk command_args="> /var/run/amd.pid 2> /dev/null" 5093250Sphk ;; 5193250Sphk esac 5293250Sphk return 0 5393250Sphk} 5493250Sphk 5593250Sphkload_rc_config $name 5693250Sphkrun_rc_command "$1" 5793250Sphk