#!/bin/sh # # Author: Mark Felder # # $FreeBSD: head/dns/nsnotifyd/files/nsnotifyd.in 466599 2018-04-05 20:37:15Z feld $ # # PROVIDE: nsnotifyd # REQUIRE: LOGIN # KEYWORD: shutdown # Add the following lines to /etc/rc.conf to enable nsnotifyd: # nsnotifyd_enable="YES" # nsnotifyd_flags="" . /etc/rc.subr echo $0 echo $_file case "$0" in /etc/rc*) # during boot (shutdown) $0 is /etc/rc (/etc/rc.shutdown), # so get the name of the script from $_file name="$_file" ;; *) name="$0" ;; esac name="${name##*/}" rcvar=${name}_enable load_rc_config $name eval ": \${${name}_enable:=\"NO\"}" eval ": \${${name}_flags:=\"\"}" echo $name echo ${name}_enable echo ${name}_flags exit stopping command="/usr/local/bin/nsnotifyd" start_precmd=precmd precmd() { if [ "${${name}_flags}x" = "x" ]; then echo "Please set your required service options via nsnotifyd_flags in /etc/rc.conf." echo "Check the contents of man nsnotifyd for more details." exit 1 fi } run_rc_command "$1"