amd revision 98774
12381Spaul#!/bin/sh 237Srgrimes# 337Srgrimes# $NetBSD: amd,v 1.10 2002/04/29 12:08:17 lukem Exp $ 437Srgrimes# $FreeBSD: head/etc/rc.d/amd 98774 2002-06-24 19:50:56Z jdp $ 537Srgrimes# 637Srgrimes 71712Scsgr# PROVIDE: amd 837Srgrimes# REQUIRE: rpcbind mountall ypbind nfsclient 9217Srgrimes# BEFORE: DAEMON 1037Srgrimes# KEYWORD: FreeBSD NetBSD 1137Srgrimes 121166Srgrimes. /etc/rc.subr 1337Srgrimes 1437Srgrimesname="amd" 1537Srgrimesrcvar=`set_rcvar` 1637Srgrimescommand="/usr/sbin/${name}" 17756Swollman 18756Swollmancase `${CMD_OSTYPE}` in 1937SrgrimesFreeBSD) 2037Srgrimes start_precmd="amd_precmd" 2137Srgrimes command_args="&" 2237Srgrimes ;; 231646SacheNetBSD) 24599Srgrimes command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid' 251221Swollman required_dirs="$amd_dir" 261221Swollman required_files="/etc/amd.conf" 272381Spaul required_vars="rpcbind" 282381Spaul ;; 2937Srgrimesesac 3037Srgrimes 3137Srgrimesamd_precmd() 3237Srgrimes{ 33144Srgrimes case `${CMD_OSTYPE}` in 341166Srgrimes FreeBSD) 351166Srgrimes if ! checkyesno nfs_client_enable ; then 361166Srgrimes force_depend nfsclient || return 1 3737Srgrimes fi 3837Srgrimes 39144Srgrimes if ! checkyesno portmap_enable && \ 40204Snate ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 4137Srgrimes then 42144Srgrimes force_depend rpcbind || return 1 4337Srgrimes fi 4437Srgrimes 45144Srgrimes case ${amd_map_program} in 4637Srgrimes [Nn][Oo] | '') 4737Srgrimes ;; 4837Srgrimes *) 4937Srgrimes amd_flags="${amd_flags} `eval ${amd_map_program}`" 50204Snate ;; 5137Srgrimes esac 5237Srgrimes 5337Srgrimes case "${amd_flags}" in 5437Srgrimes '') 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