All pastes #771688 Raw Edit

dnsdoggy.sh

public shellscript v1 · immutable
·published 2007-11-13 03:45 UTC
rendered paste body
#!/bin/sh## PROVIDE: dnsdoggy# REQUIRE: LOGIN# KEYWORD: FreeBSD shutdown# AUTHOR:  Shabranigdo, dark lord of chaosdnsdoggy_enable=${dnsdoggy_enable:-"YES"}. /etc/rc.subrname="dnsdoggy"rcvar=`set_rcvar`command="/root/bin/dns.doggy.sh"command_args=""pidfile="/var/run/${name}.pid"start_cmd="${name}_start"stop_cmd="${name}_stop"dnsdoggy_start(){  pid=$(check_pidfile ${pidfile} "${command}" "/bin/sh")  if [ -z "${pid}" ] ; then    echo "starting dnsdoggy"    daemon -c -f -p ${pidfile} ${command}  else    echo "pidfile exists - ${name} process already started?"    return 1  fi}dnsdoggy_stop(){  pid=$(check_pidfile ${pidfile} "${command}" "/bin/sh")  if [ -z "${pid}" ]; then    echo ${name} not running?  Check ${pidfile}    return 1  fi  echo "Stopping ${name}"  kill -${sig_stop:-TERM} ${pid}  [ $? -ne 0 ] && [ -z "$rc_force" ] && return 1  wait_for_pids ${pid}}load_rc_config $namerun_rc_command "$1"