freebsd-ports/net/gmid/files/gmid.in
Omar Polo b7125c22c6 net/gmid: fix rc script
Also bump PORTREVISION.

PR:	255530
2021-05-05 18:30:46 -07:00

42 lines
773 B
Bash

#!/bin/sh
#
# PROVIDE: gmid
# REQUIRE: SERVERS
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable gmid:
# gmid_enable (bool): Set it to "YES" to enable gmid
# Default is "NO".
# gmid_config (string): Path to gmid configuration file.
# Default is "%%PREFIX%%/etc/gmid.conf"
#
#
. /etc/rc.subr
name="gmid"
rcvar="gmid_enable"
start_precmd="gmid_checkconfig"
configtest_cmd="gmid_checkconfig"
extra_commands="configtest"
: ${gmid_enable:="NO"}
: ${gmid_config:="%%PREFIX%%/etc/gmid.conf"}
load_rc_config $name
command="%%PREFIX%%/bin/${name}"
gmid_flags="-c ${gmid_config}"
required_files="${gmid_config}"
gmid_checkconfig()
{
echo "Performing sanity check on gmid configuration:"
eval ${command} -n ${gmid_flags}
}
run_rc_command "$1"