Added
Link Here
|
1 |
#!/bin/sh |
2 |
# |
3 |
|
4 |
# PROVIDE: gmid |
5 |
# REQUIRE: SERVERS |
6 |
# KEYWORD: shutdown |
7 |
|
8 |
# |
9 |
# Add the following lines to /etc/rc.conf to enable gmid: |
10 |
# gmid_enable (bool): Set it to "YES" to enable gmid |
11 |
# Default is "NO". |
12 |
# gmid_config (string): Path to gmid configuration file. |
13 |
# Default is "%%PREFIX%%/etc/gmid.conf" |
14 |
# |
15 |
# |
16 |
|
17 |
. /etc/rc.subr |
18 |
|
19 |
name="gmid" |
20 |
rcvar="gmid_enable" |
21 |
|
22 |
start_precmd="gmid_checkconfig" |
23 |
configtest_cmd="gmid_checkconfig" |
24 |
extra_commands="configtest" |
25 |
|
26 |
: ${gmid_enable:="NO"} |
27 |
: ${gmid_config:="%%PREFIX%%/etc/gmid.conf"} |
28 |
|
29 |
load_rc_config $name |
30 |
|
31 |
command="%%PREFIX%%/bin/${name}" |
32 |
command_flags="-c ${gmid_config}" |
33 |
|
34 |
required_files="${gmid_config}" |
35 |
|
36 |
gmid_checkconfig() |
37 |
{ |
38 |
echo "Performing sanity check on gmid configuration:" |
39 |
eval ${command} -n ${command_flags} |
40 |
} |
41 |
|
42 |
run_rc_command "$1" |