#! /bin/sh
# Generated by ../utrans from:
#  843c4f9142c604daed198c434b6677a4fd6f45a395434818261679d07aead773  ./input/openntpd.service

# kFreeBSD does not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
   set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
### BEGIN INIT INFO
# Provides: openntpd
# Required-Start: $remote_fs
# Required-Stop: $remote_fs
# Should-Start: $network
# Should-Stop: $network
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Description: OpenNTPd Network Time Protocol
### END INIT INFO
DESC="OpenNTPd Network Time Protocol"
DAEMON="/usr/sbin/ntpd"
set -a
RUNTIME_DIRECTORY='/run/openntpd'
[ -r /etc/default/openntpd ] && . /dev/stdin <<EOF
$(sed -z 's#[[:space:]]*\\\n#\\#g' /etc/default/openntpd | grep '^[[:space:]]*[^#;].\+=')
EOF
set +a
DAEMON_ARGS="$DAEMON_OPTS"
SETPRIV_ARGS="--no-new-privs --bounding-set -all,+NET_BIND_SERVICE,+SETGID,+SETUID,+SYSLOG,+SYS_CHROOT,+SYS_NICE,+SYS_TIME"
PIDFILE="none"
do_start_prepare() {
  mkdir -p "${RUNTIME_DIRECTORY:?}"
  /usr/sbin/ntpd -n $DAEMON_OPTS
}
do_stop_cleanup() {
  rm -r "${RUNTIME_DIRECTORY:?}"
}
