michael@64: #!@l_prefix@/bin/openpkg rc michael@64: ## michael@64: ## rc.arpwatch -- runcommands michael@64: ## michael@64: michael@64: %config michael@64: arpwatch_enable="$openpkg_rc_def" michael@64: arpwatch_log_prolog="true" michael@64: arpwatch_log_epilog="true" michael@64: arpwatch_log_numfiles="10" michael@64: arpwatch_log_minsize="1M" michael@64: arpwatch_log_complevel="9" michael@64: arpwatch_iface="-i lo0" michael@64: arpwatch_ipnet="-n 127.0.0.0/8" michael@64: michael@64: %common michael@64: arpwatch_pidfile="@l_prefix@/var/arpwatch/run/arpwatch.pid" michael@64: arpwatch_signal () { michael@64: [ -f $arpwatch_pidfile ] && kill -$1 `cat $arpwatch_pidfile` michael@64: } michael@64: michael@64: %status -u @l_susr@ -o michael@64: arpwatch_usable="no" michael@64: arpwatch_active="no" michael@64: rcService arpwatch enable yes && \ michael@64: arpwatch_usable="yes" michael@64: rcService arpwatch enable yes && \ michael@64: arpwatch_signal 0 && arpwatch_active="yes" michael@64: echo "arpwatch_enable=\"$arpwatch_enable\"" michael@64: echo "arpwatch_usable=\"$arpwatch_usable\"" michael@64: echo "arpwatch_active=\"$arpwatch_active\"" michael@64: michael@64: %start -u @l_susr@ michael@64: rcService arpwatch enable yes || exit 0 michael@64: rcService arpwatch active yes && exit 0 michael@64: @l_prefix@/sbin/arpwatch \ michael@64: $arpwatch_iface \ michael@64: $arpwatch_ipnet \ michael@64: >$arpwatch_pidfile 2>&1 michael@64: michael@64: %stop -u @l_susr@ michael@64: rcService arpwatch enable yes || exit 0 michael@64: rcService arpwatch active no && exit 0 michael@64: arpwatch_signal TERM michael@64: michael@64: %restart -u @l_susr@ michael@64: rcService arpwatch enable yes || exit 0 michael@64: rcService arpwatch active no && exit 0 michael@64: rc arpwatch stop michael@64: sleep 2 michael@64: rc arpwatch start michael@64: michael@64: %reload -u @l_susr@ michael@64: rcService arpwatch enable yes || exit 0 michael@64: rcService arpwatch active no && exit 0 michael@64: arpwatch_signal HUP michael@64: michael@64: %daily -u @l_susr@ michael@64: rcService arpwatch enable yes || exit 0 michael@64: shtool rotate -f \ michael@64: -n ${arpwatch_log_numfiles} -s ${arpwatch_log_minsize} -d \ michael@64: -z ${arpwatch_log_complevel} -o @l_susr@ -g @l_mgrp@ -m 644 \ michael@64: -P "${arpwatch_log_prolog}" \ michael@64: -E "${arpwatch_log_epilog}; rc arpwatch restart" \ michael@64: @l_prefix@/var/arpwatch/log/arpwatch.log \ michael@64: @l_prefix@/var/arpwatch/log/arpsnmp.log