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