You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
1.7 KiB
70 lines
1.7 KiB
#!@l_prefix@/lib/openpkg/bash @l_prefix@/etc/rc |
|
## |
|
## rc.arpd -- Run-Commands |
|
## |
|
|
|
%config |
|
arpd_enable="$openpkg_rc_def" |
|
arpd_interface="" |
|
arpd_listen="" |
|
arpd_log_prolog="true" |
|
arpd_log_epilog="true" |
|
arpd_log_numfiles="10" |
|
arpd_log_minsize="1M" |
|
arpd_log_complevel="9" |
|
|
|
%common |
|
arpd_pidfile="@l_prefix@/var/arpd/arpd.pid" |
|
arpd_signal () { |
|
[ -f $arpd_pidfile ] && kill -$1 `cat $arpd_pidfile` |
|
} |
|
|
|
%status -u @l_susr@ -o |
|
arpd_usable="unknown" |
|
arpd_active="no" |
|
rcService arpd enable yes && \ |
|
arpd_signal 0 && arpd_active="yes" |
|
echo "arpd_enable=\"$arpd_enable\"" |
|
echo "arpd_usable=\"$arpd_usable\"" |
|
echo "arpd_active=\"$arpd_active\"" |
|
|
|
%start -u @l_susr@ |
|
rcService arpd enable yes || exit 0 |
|
rcService arpd active yes && exit 0 |
|
opts="" |
|
if [ ".$arpd_interface" != . ]; then |
|
opts="$opts -i $arpd_interface" |
|
fi |
|
if [ ".$arpd_listen" != . ]; then |
|
opts="$opts $arpd_listen" |
|
fi |
|
@l_prefix@/sbin/arpd $opts >/dev/null 2>&1 |
|
|
|
%stop -u @l_susr@ |
|
rcService arpd enable yes || exit 0 |
|
rcService arpd active no && exit 0 |
|
arpd_signal TERM |
|
|
|
%restart -u @l_susr@ |
|
rcService arpd enable yes || exit 0 |
|
rcService arpd active no && exit 0 |
|
rc arpd start |
|
sleep 2 |
|
rc arpd stop |
|
|
|
%reload -u @l_susr@ |
|
rcService arpd enable yes || exit 0 |
|
rcService arpd active no && exit 0 |
|
arpd_signal HUP |
|
|
|
%daily -u @l_susr@ |
|
rcService arpd enable yes || exit 0 |
|
|
|
# rotate logfile |
|
shtool rotate -f \ |
|
-n ${arpd_log_numfiles} -s ${arpd_log_minsize} -d \ |
|
-z ${arpd_log_complevel} -o @l_rusr@ -g @l_rgrp@ -m 644 \ |
|
-P "${arpd_log_prolog}" \ |
|
-E "${arpd_log_epilog} && rc arpd restart" \ |
|
@l_prefix@/var/arpd/arpd.log |
|
|
|
|