amd revision 101851
178344Sobrien#!/bin/sh 278344Sobrien# 398184Sgordon# $NetBSD: amd,v 1.10 2002/04/29 12:08:17 lukem Exp $ 498184Sgordon# $FreeBSD: head/etc/rc.d/amd 101851 2002-08-14 05:44:32Z gordon $ 578344Sobrien# 678344Sobrien 778344Sobrien# PROVIDE: amd 898184Sgordon# REQUIRE: rpcbind mountall ypbind nfsclient 998184Sgordon# BEFORE: DAEMON 1098184Sgordon# KEYWORD: FreeBSD NetBSD 1178344Sobrien 1278344Sobrien. /etc/rc.subr 1378344Sobrien 1478344Sobrienname="amd" 1598184Sgordonrcvar=`set_rcvar` 1698585Sdougbcommand="/usr/sbin/${name}" 1778344Sobrien 1898184Sgordoncase `${CMD_OSTYPE}` in 1998184SgordonFreeBSD) 2098184Sgordon start_precmd="amd_precmd" 2198774Sjdp command_args="&" 2298184Sgordon ;; 2398184SgordonNetBSD) 2498184Sgordon command_args='-p -a '$amd_dir' -F /etc/amd.conf >/var/run/amd.pid' 2598184Sgordon required_dirs="$amd_dir" 2698184Sgordon required_files="/etc/amd.conf" 2798184Sgordon required_vars="rpcbind" 2898184Sgordon ;; 2998184Sgordonesac 3078344Sobrien 3198184Sgordonamd_precmd() 3298184Sgordon{ 3398184Sgordon case `${CMD_OSTYPE}` in 3498184Sgordon FreeBSD) 3598184Sgordon if ! checkyesno nfs_client_enable ; then 3698184Sgordon force_depend nfsclient || return 1 3798184Sgordon fi 3898486Sdougb 39101851Sgordon if ! checkyesno rpcbind_enable && \ 4098585Sdougb ! /etc/rc.d/rpcbind forcestatus 1>/dev/null 2>&1 4198486Sdougb then 4298184Sgordon force_depend rpcbind || return 1 4398184Sgordon fi 4498184Sgordon 4598184Sgordon case ${amd_map_program} in 4698184Sgordon [Nn][Oo] | '') 4798184Sgordon ;; 4898184Sgordon *) 4998184Sgordon amd_flags="${amd_flags} `eval ${amd_map_program}`" 5098184Sgordon ;; 5198184Sgordon esac 5298184Sgordon 5398184Sgordon case "${amd_flags}" in 5498184Sgordon '') 5598184Sgordon if [ ! -r /etc/amd.conf ]; then 5698184Sgordon warn 'amd will not load without arguments' 5798184Sgordon return 1 5898184Sgordon fi 5998184Sgordon ;; 6098184Sgordon *) 6198184Sgordon amd_flags="-p ${amd_flags} > /var/run/amd.pid 2> /dev/null" \ 6298184Sgordon ;; 6398184Sgordon esac 6498184Sgordon ;; 6598184Sgordon esac 6698184Sgordon return 0 6798184Sgordon} 6898184Sgordon 6998184Sgordonload_rc_config $name 7078344Sobrienrun_rc_command "$1" 71