mirror of
https://github.com/novatiq/packages.git
synced 2026-04-30 15:38:40 +01:00
banip: update 0.3.6
* more startup tweaks
* re-use f_log function in helper scripts
* small fixes / polish up for forthcoming 19.07 release
Signed-off-by: Dirk Brenken <dev@brenken.org>
(cherry picked from commit 72fba3a17b)
This commit is contained in:
@@ -12,14 +12,15 @@ ban_init="/etc/init.d/banip"
|
||||
ban_script="/usr/bin/banip.sh"
|
||||
ban_pidfile="/var/run/banip.pid"
|
||||
|
||||
if [ -s "${ban_pidfile}" ] && [ "${action}" != "help" ] && [ "${action}" != "status" ]
|
||||
if [ -s "${ban_pidfile}" ] && \
|
||||
[ "${action}" != "help" ] && [ "${action}" != "status" ] && [ "${action}" != "boot" ]
|
||||
then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
boot()
|
||||
{
|
||||
ban_boot="1"
|
||||
[ -s "${ban_pidfile}" ] && > "${ban_pidfile}"
|
||||
rc_procd start_service
|
||||
}
|
||||
|
||||
@@ -27,15 +28,14 @@ start_service()
|
||||
{
|
||||
if [ "$("${ban_init}" enabled; printf "%u" ${?})" -eq 0 ]
|
||||
then
|
||||
if [ "${ban_boot}" = "1" ]
|
||||
if [ "${action}" = "boot" ]
|
||||
then
|
||||
return 0
|
||||
fi
|
||||
local nice="$(uci_get banip extra ban_nice "0")"
|
||||
procd_open_instance "banip"
|
||||
procd_set_param command "${ban_script}" "${@}"
|
||||
procd_set_param pidfile "${ban_pidfile}"
|
||||
procd_set_param nice "${nice}"
|
||||
procd_set_param nice "$(uci_get banip extra ban_nice "0")"
|
||||
procd_set_param stdout 1
|
||||
procd_set_param stderr 1
|
||||
procd_close_instance
|
||||
|
||||
Reference in New Issue
Block a user