amd revision 98486
1#!/bin/sh 2# 3# $NetBSD: amd,v 1.10 2002/04/29 12:08:17 lukem Exp $ 4# $FreeBSD: head/etc/rc.d/amd 98486 2002-06-20 08:49:44Z dougb $ 5# 6 7# PROVIDE: amd 8# REQUIRE: rpcbind mountall ypbind nfsclient 9# BEFORE: DAEMON 10# KEYWORD: FreeBSD NetBSD 11 12. /etc/rc.subr 13 14name="amd" 15rcvar=`set_rcvar` 16 17case `${CMD_OSTYPE}` in 18FreeBSD) 19 start_cmd="echo 'Starting amd.'; /usr/sbin/${name} &" 20 start_precmd="amd_precmd" 21 ;; 22NetBSD) 23 command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid' 24 required_dirs="$amd_dir" 25 required_files="/etc/amd.conf" 26 required_vars="rpcbind" 27 command="/usr/sbin/${name}" 28 ;; 29esac 30 31amd_precmd() 32{ 33 case `${CMD_OSTYPE}` in 34 FreeBSD) 35 if ! checkyesno nfs_client_enable ; then 36 force_depend nfsclient || return 1 37 fi 38 39 if ! checkyesno portmap_enable && \ 40 [ -z "`check_process ${portmap_program}`" ] 41 then 42 force_depend rpcbind || return 1 43 fi 44 45 case ${amd_map_program} in 46 [Nn][Oo] | '') 47 ;; 48 *) 49 amd_flags="${amd_flags} `eval ${amd_map_program}`" 50 ;; 51 esac 52 53 case "${amd_flags}" in 54 '') 55 if [ ! -r /etc/amd.conf ]; then 56 warn 'amd will not load without arguments' 57 return 1 58 fi 59 ;; 60 *) 61 amd_flags="-p ${amd_flags} > /var/run/amd.pid 2> /dev/null" \ 62 ;; 63 esac 64 ;; 65 esac 66 return 0 67} 68 69load_rc_config $name 70run_rc_command "$1" 71