mirror of
https://git.FreeBSD.org/ports.git
synced 2024-12-19 03:52:17 +00:00
4a5694585f
and add a 'configtest' rc(8) target. Also note openntpd_flags in the comments at the top of the rc(8) script. PORTREVISION bump for rc(8) script change. PR: 210153 Approved by: naddy (maintainer)
51 lines
1.0 KiB
Bash
51 lines
1.0 KiB
Bash
#!/bin/sh
|
|
#
|
|
# $FreeBSD$
|
|
#
|
|
# PROVIDE: openntpd
|
|
# REQUIRE: DAEMON ntpdate
|
|
# BEFORE: LOGIN
|
|
# KEYWORD: nojail shutdown
|
|
#
|
|
# Add the following lines to /etc/rc.conf.local or /etc/rc.conf
|
|
# to enable this service:
|
|
#
|
|
# openntpd_enable (bool): Set to NO by default.
|
|
# Set it to YES to enable openntpd.
|
|
# openntpd_config (str): Path to ntpd.conf
|
|
# Default: %%PREFIX%%/etc/ntpd.conf
|
|
# openntpd_flags (str): Flags passed to ntpd(8)
|
|
# Default: none
|
|
|
|
. /etc/rc.subr
|
|
|
|
name=openntpd
|
|
rcvar=openntpd_enable
|
|
|
|
start_precmd="openntpd_checkconfig"
|
|
restart_precmd="openntpd_checkconfig"
|
|
configtest_cmd="openntpd_checkconfig"
|
|
extra_commands="configtest"
|
|
|
|
load_rc_config $name
|
|
|
|
: ${openntpd_enable:="NO"}
|
|
: ${openntpd_config:="%%PREFIX%%/etc/ntpd.conf"}
|
|
|
|
command=%%PREFIX%%/sbin/ntpd
|
|
command_args="-f ${openntpd_config}"
|
|
required_files=${openntpd_config}
|
|
|
|
check_process()
|
|
{
|
|
pgrep -f $command
|
|
}
|
|
|
|
openntpd_checkconfig()
|
|
{
|
|
echo "Performing sanity check on ${name} configuration:"
|
|
eval ${command} ${command_args} ${openntpd_flags} -n
|
|
}
|
|
|
|
run_rc_command "$1"
|