]> CyberLeo.Net >> Repos - FreeBSD/releng/9.2.git/blob - etc/rc.d/amd
- Copy stable/9 to releng/9.2 as part of the 9.2-RELEASE cycle.
[FreeBSD/releng/9.2.git] / etc / rc.d / amd
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
13 name="amd"
14 rcvar="amd_enable"
15 command="/usr/sbin/${name}"
16 start_precmd="amd_precmd"
17 command_args="&"
18 extra_commands="reload"
19
20 amd_precmd()
21 {
22         force_depend nfsclient nfs_client || return 1
23         force_depend rpcbind || return 1
24
25         case ${amd_map_program} in
26         [Nn][Oo] | '')
27                 ;;
28         *)
29                 rc_flags="${rc_flags} `echo $(eval ${amd_map_program})`"
30                 ;;
31         esac
32
33         case "${amd_flags}" in
34         '')
35                 if [ ! -r /etc/amd.conf ]; then
36                         warn 'amd will not load without arguments'
37                         return 1
38                 fi
39                 ;;
40         *)
41                 rc_flags="-p ${rc_flags}"
42                 command_args="> /var/run/amd.pid 2> /dev/null"
43                 ;;
44         esac
45 }
46
47 load_rc_config $name
48 run_rc_command "$1"