Skip to content

Commit 571350b

Browse files
committed
Merge Official Source
Signed-off-by: Tianling Shen <[email protected]>
2 parents 645a6eb + 56139cc commit 571350b

File tree

37 files changed

+346
-143
lines changed

37 files changed

+346
-143
lines changed

libs/libfmt/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,13 @@
88
include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=libfmt
11-
PKG_VERSION:=11.1.2
11+
PKG_VERSION:=11.1.3
1212
PKG_RELEASE:=1
1313

1414
PKG_SOURCE_NAME:=fmt
1515
PKG_SOURCE:=$(PKG_SOURCE_NAME)-$(PKG_VERSION).tar.gz
1616
PKG_SOURCE_URL:=https://codeload.github.com/fmtlib/$(PKG_SOURCE_NAME)/tar.gz/$(PKG_VERSION)?
17-
PKG_HASH:=d8773cf062cc806d4dd4df658111f15ba7a2c9c65db5084d2491696828b1eb97
17+
PKG_HASH:=67cd23ea86ccc359693e2ce1ba8d1bab533c02d743c09b15f3131102d0c2fc1c
1818
PKG_BUILD_DIR:=$(BUILD_DIR)/$(PKG_SOURCE_NAME)-$(PKG_VERSION)
1919

2020
PKG_MAINTAINER:=Othmar Truniger <[email protected]>

libs/srt/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,12 +8,12 @@
88
include $(TOPDIR)/rules.mk
99

1010
PKG_NAME:=srt
11-
PKG_VERSION:=1.5.3
11+
PKG_VERSION:=1.5.4
1212
PKG_RELEASE:=1
1313

1414
PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
1515
PKG_SOURCE_URL:=https://codeload.github.com/haivision/srt/tar.gz/v$(PKG_VERSION)?
16-
PKG_HASH:=befaeb16f628c46387b898df02bc6fba84868e86a6f6d8294755375b9932d777
16+
PKG_HASH:=d0a8b600fe1b4eaaf6277530e3cfc8f15b8ce4035f16af4a5eb5d4b123640cdd
1717
PKG_MAINTAINER:=Koen Vandeputte <[email protected]>
1818

1919
PKG_LICENSE:=MPL-2.0

net/adblock/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ include $(TOPDIR)/rules.mk
77

88
PKG_NAME:=adblock
99
PKG_VERSION:=4.2.4
10-
PKG_RELEASE:=1
10+
PKG_RELEASE:=2
1111
PKG_LICENSE:=GPL-3.0-or-later
1212
PKG_MAINTAINER:=Dirk Brenken <[email protected]>
1313

@@ -22,7 +22,7 @@ define Package/adblock
2222
endef
2323

2424
define Package/adblock/description
25-
Powerful adblock solution to block ad/abuse domains via dnsmasq, unbound, named or kresd.
25+
Powerful adblock solution to block ad/abuse domains via dnsmasq, unbound, named, smartdns or kresd.
2626
The script supports many domain blacklist sites plus manual black- and whitelist overrides.
2727
Please see https://github.com/openwrt/packages/blob/master/net/adblock/files/README.md for further information.
2828

net/adblock/files/adblock.sh

Lines changed: 43 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,11 @@ f_load() {
133133
if [ -z "${adb_repiface}" ]; then
134134
network_get_device iface "lan"
135135
[ -z "${iface}" ] && network_get_physdev iface "lan"
136-
[ -n "${iface}" ] && adb_repiface="${iface}"
137-
[ -n "${adb_repiface}" ] && { uci_set adblock global adb_repiface "${adb_repiface}"; f_uci "adblock"; }
136+
if [ -n "${iface}" ]; then
137+
adb_repiface="${iface}"
138+
uci_set adblock global adb_repiface "${adb_repiface}"
139+
f_uci "adblock"
140+
fi
138141
fi
139142

140143
if [ -n "${adb_repiface}" ] && [ -d "${adb_reportdir}" ]; then
@@ -342,7 +345,7 @@ f_dns() {
342345
adb_dnsdeny="${adb_dnsdeny:-"${adb_awkcmd} '{print \"address /\"\$0\"/#\"}'"}"
343346
adb_dnsallow="${adb_dnsallow:-"${adb_awkcmd} '{print \"address /\"\$0\"/-\"}'"}"
344347
adb_dnssafesearch="${adb_dnssafesearch:-"${adb_awkcmd} -v item=\"\$item\" '{print \"cname /\"\$0\"/\"item\"\"}'"}"
345-
adb_dnsstop="${adb_dnsstop:-"0"}"
348+
adb_dnsstop="${adb_dnsstop:-"address #"}"
346349
;;
347350
"raw")
348351
adb_dnscachecmd="-"
@@ -461,25 +464,21 @@ f_rmdns() {
461464
# commit uci changes
462465
#
463466
f_uci() {
464-
local change config="${1}"
467+
local config="${1}"
465468

466469
if [ -n "${config}" ]; then
467-
change="$(uci -q changes "${config}" | "${adb_awkcmd}" '{ORS=" "; print $0}')"
468-
if [ -n "${change}" ]; then
469-
uci_commit "${config}"
470-
case "${config}" in
471-
"firewall")
472-
"/etc/init.d/firewall" reload >/dev/null 2>&1
473-
;;
474-
"resolver")
475-
printf "%b" "${adb_dnsheader}" >"${adb_dnsdir}/${adb_dnsfile}"
476-
f_count
477-
f_jsnup "running"
478-
"/etc/init.d/${adb_dns}" reload >/dev/null 2>&1
479-
;;
480-
esac
481-
fi
482-
f_log "debug" "f_uci ::: config: ${config}, change: ${change}"
470+
uci_commit "${config}"
471+
case "${config}" in
472+
"firewall")
473+
"/etc/init.d/firewall" reload >/dev/null 2>&1
474+
;;
475+
"resolver")
476+
printf "%b" "${adb_dnsheader}" >"${adb_dnsdir}/${adb_dnsfile}"
477+
f_count
478+
f_jsnup "running"
479+
"/etc/init.d/${adb_dns}" reload >/dev/null 2>&1
480+
;;
481+
esac
483482
fi
484483
}
485484

@@ -550,16 +549,28 @@ f_extconf() {
550549
for zone in ${adb_zonelist}; do
551550
for port in ${adb_portlist}; do
552551
if ! printf "%s" "${fwcfg}" | "${adb_grepcmd}" -q "adblock_${zone}${port}[ |\$]"; then
553-
uci -q batch <<-EOC
554-
set firewall."adblock_${zone}${port}"="redirect"
555-
set firewall."adblock_${zone}${port}".name="Adblock DNS (${zone}, ${port})"
556-
set firewall."adblock_${zone}${port}".src="${zone}"
557-
set firewall."adblock_${zone}${port}".proto="tcp udp"
558-
set firewall."adblock_${zone}${port}".src_dport="${port}"
559-
set firewall."adblock_${zone}${port}".dest_port="${port}"
560-
set firewall."adblock_${zone}${port}".target="DNAT"
561-
set firewall."adblock_${zone}${port}".family="any"
562-
EOC
552+
if [ "${port}" = "53" ]; then
553+
uci -q batch <<-EOC
554+
set firewall."adblock_${zone}${port}"="redirect"
555+
set firewall."adblock_${zone}${port}".name="Adblock DNS (${zone}, ${port})"
556+
set firewall."adblock_${zone}${port}".src="${zone}"
557+
set firewall."adblock_${zone}${port}".proto="tcp udp"
558+
set firewall."adblock_${zone}${port}".src_dport="${port}"
559+
set firewall."adblock_${zone}${port}".dest_port="${port}"
560+
set firewall."adblock_${zone}${port}".target="DNAT"
561+
set firewall."adblock_${zone}${port}".family="any"
562+
EOC
563+
else
564+
uci -q batch <<-EOC
565+
set firewall."adblock_${zone}${port}"="rule"
566+
set firewall."adblock_${zone}${port}".name="Adblock DNS (${zone}, ${port})"
567+
set firewall."adblock_${zone}${port}".src="${zone}"
568+
set firewall."adblock_${zone}${port}".proto="tcp udp"
569+
set firewall."adblock_${zone}${port}".dest_port="${port}"
570+
set firewall."adblock_${zone}${port}".target="REJECT"
571+
set firewall."adblock_${zone}${port}".dest="*"
572+
EOC
573+
fi
563574
fi
564575
fwcfg="${fwcfg/adblock_${zone}${port}[ |\$]/}"
565576
done
@@ -1058,8 +1069,8 @@ f_log() {
10581069
local class="${1}" log_msg="${2}"
10591070

10601071
if [ -n "${log_msg}" ] && { [ "${class}" != "debug" ] || [ "${adb_debug}" = "1" ]; }; then
1061-
[ -x "${adb_loggercmd}" ] && "${adb_loggercmd}" -p "${class}" -t "adblock-${adb_ver}[${$}]" "${log_msg}" || \
1062-
printf "%s %s %s\n" "${class}" "adblock-${adb_ver}[${$}]" "${log_msg}"
1072+
[ -x "${adb_loggercmd}" ] && "${adb_loggercmd}" -p "${class}" -t "adblock-${adb_ver}[${$}]" "${log_msg::256}" || \
1073+
printf "%s %s %s\n" "${class}" "adblock-${adb_ver}[${$}]" "${log_msg::256}"
10631074
if [ "${class}" = "err" ] || [ "${class}" = "emerg" ]; then
10641075
[ "${adb_action}" != "mail" ] && f_rmdns
10651076
f_jsnup "error"

net/banip/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@
55
include $(TOPDIR)/rules.mk
66

77
PKG_NAME:=banip
8-
PKG_VERSION:=1.5.0
9-
PKG_RELEASE:=6
8+
PKG_VERSION:=1.5.1
9+
PKG_RELEASE:=1
1010
PKG_LICENSE:=GPL-3.0-or-later
1111
PKG_MAINTAINER:=Dirk Brenken <[email protected]>
1212

net/banip/files/README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ IP address blocking is commonly used to protect against brute force attacks, pre
8686
* Automatic blocklist backup & restore, the backups will be used in case of download errors or during startup
8787
* Automatically selects one of the following download utilities with ssl support: aria2c, curl, uclient-fetch or full wget
8888
* Provides HTTP ETag support to download only ressources that have been updated on the server side, to speed up banIP reloads and to save bandwith
89-
* Supports an 'allowlist only' mode, this option skips all blocklists and restricts the internet access only to specific, explicitly allowed IP segments
89+
* Supports an 'allowlist only' mode, this option restricts the internet access only to specific, explicitly allowed IP segments
9090
* Supports external allowlist URLs to reference additional IPv4/IPv6 feeds
9191
* Optionally always allow certain protocols/destination ports in the inbound chain
9292
* Deduplicate IPs accross all Sets (single IPs only, no intervals)
@@ -174,7 +174,7 @@ Available commands:
174174
| ban_autoblocklist | option | 1 | add suspicious attacker IPs and resolved domains automatically to the local blocklist (not only to the Sets) |
175175
| ban_autoblocksubnet | option | 0 | add entire subnets to the blocklist Sets based on an additional RDAP request with the suspicious IP |
176176
| ban_autoallowuplink | option | subnet | limit the uplink autoallow function to: 'subnet', 'ip' or 'disable' it at all |
177-
| ban_allowlistonly | option | 0 | skip all blocklists and restrict the internet access only to specific, explicitly allowed IP segments |
177+
| ban_allowlistonly | option | 0 | restrict the internet access only to specific, explicitly allowed IP segments |
178178
| ban_allowflag | option | - | always allow certain protocols(tcp or udp) plus destination ports or port ranges, e.g.: 'tcp 80 443-445' |
179179
| ban_allowurl | list | - | external allowlist feed URLs, one or more references to simple remote IP lists |
180180
| ban_basedir | option | /tmp | base working directory while banIP processing |
@@ -370,7 +370,7 @@ Furthermore, you can reference external Allowlist URLs with additional IPv4 and
370370
Both local lists also accept domain names as input to allow IP filtering based on these names. The corresponding IPs (IPv4 & IPv6) will be extracted and added to the Sets. You can also start the domain lookup separately via /etc/init.d/banip lookup at any time.
371371

372372
**Allowlist-only mode**
373-
banIP supports an "allowlist only" mode. This option skips all blocklists and restricts Internet access only to certain, explicitly permitted IP segments - and blocks access to the rest of the Internet. All IPs that are _not_ listed in the allowlist or in the external allowlist URLs are blocked. In this mode it might be useful to limit the allowlist feed to the inbound chain, to still allow outbound communication to the rest of the world.
373+
banIP supports an "allowlist only" mode. This option restricts Internet access only to certain, explicitly permitted IP segments - and blocks access to the rest of the Internet. All IPs that are _not_ listed in the allowlist or in the external allowlist URLs are blocked. In this mode it might be useful to limit the allowlist feed to the inbound chain, to still allow outbound communication to the rest of the world.
374374

375375
**MAC/IP-binding**
376376
banIP supports concatenation of local MAC addresses/ranges with IPv4/IPv6 addresses, e.g. to enforce dhcp assignments or to free connected clients from outbound blocking.

net/banip/files/banip-functions.sh

Lines changed: 13 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -99,14 +99,13 @@ ban_debug="0"
9999
f_system() {
100100
local cpu core
101101

102-
if [ -z "${ban_dev}" ]; then
103-
ban_debug="$(uci_get banip global ban_debug "0")"
104-
ban_cores="$(uci_get banip global ban_cores)"
105-
fi
102+
ban_debug="$(uci_get banip global ban_debug "0")"
103+
ban_cores="$(uci_get banip global ban_cores)"
106104
ban_packages="$("${ban_ubuscmd}" -S call rpc-sys packagelist '{ "all": true }' 2>/dev/null)"
107105
ban_ver="$(printf "%s" "${ban_packages}" | "${ban_jsoncmd}" -ql1 -e '@.packages.banip')"
108106
ban_sysver="$("${ban_ubuscmd}" -S call system board 2>/dev/null | "${ban_jsoncmd}" -ql1 -e '@.model' -e '@.release.target' -e '@.release.distribution' -e '@.release.version' -e '@.release.revision' |
109107
"${ban_awkcmd}" 'BEGIN{RS="";FS="\n"}{printf "%s, %s, %s %s %s %s",$1,$2,$3,$4,$5,$6}')"
108+
110109
if [ -z "${ban_cores}" ]; then
111110
cpu="$("${ban_grepcmd}" -c '^processor' /proc/cpuinfo 2>/dev/null)"
112111
core="$("${ban_grepcmd}" -cm1 '^core id' /proc/cpuinfo 2>/dev/null)"
@@ -608,17 +607,17 @@ f_etag() {
608607
# load file in nftset
609608
#
610609
f_nftload() {
611-
local cnt="1" max_cnt="${ban_nftretry:-"5"}" load_rc="4" load_log="" file="${1}" errmsg="${2}"
610+
local cnt="1" max_cnt="${ban_nftretry:-"5"}" load_rc="4" file="${1}" errmsg="${2}"
612611

613612
while [ "${load_rc}" != "0" ]; do
614-
load_log="$("${ban_nftcmd}" -f "${file}" 2>&1)"
613+
"${ban_nftcmd}" -f "${file}" >/dev/null 2>&1
615614
load_rc="${?}"
616615
if [ "${load_rc}" = "0" ]; then
617616
break
618617
elif [ "${cnt}" = "${max_cnt}" ]; then
619618
[ ! -d "${ban_errordir}" ] && f_mkdir "${ban_errordir}"
620619
"${ban_catcmd}" "${file}" 2>/dev/null >"${ban_errordir}/err.${file##*/}"
621-
f_log "info" "${errmsg}, ${load_log::256}"
620+
f_log "info" "${errmsg}"
622621
break
623622
fi
624623
cnt="$((cnt + 1))"
@@ -677,7 +676,7 @@ f_nftinit() {
677676
printf "%s\n" "add table inet banIP"
678677
# base chains
679678
#
680-
printf "%s\n" "add chain inet banIP pre-routing { type filter hook prerouting priority -199; policy accept; }"
679+
printf "%s\n" "add chain inet banIP pre-routing { type filter hook prerouting priority -175; policy accept; }"
681680
printf "%s\n" "add chain inet banIP wan-input { type filter hook input priority ${ban_nftpriority}; policy accept; }"
682681
printf "%s\n" "add chain inet banIP wan-forward { type filter hook forward priority ${ban_nftpriority}; policy accept; }"
683682
printf "%s\n" "add chain inet banIP lan-forward { type filter hook forward priority ${ban_nftpriority}; policy accept; }"
@@ -1737,7 +1736,12 @@ f_survey() {
17371736
printf "%s\n%s\n%s\n" ":::" "::: no valid survey input" ":::"
17381737
return
17391738
fi
1740-
set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]')"
1739+
1740+
if [ "$(uci_get banip global ban_nftcount)" = "1" ]; then
1741+
set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*].elem.val')"
1742+
else
1743+
set_elements="$("${ban_nftcmd}" -j list set inet banIP "${input}" 2>/dev/null | "${ban_jsoncmd}" -qe '@.nftables[*].set.elem[*]')"
1744+
fi
17411745
printf "%s\n%s\n%s\n" ":::" "::: banIP Survey" ":::"
17421746
printf " %s\n" "List of elements in the Set '${input}' on $(date "+%Y-%m-%d %H:%M:%S")"
17431747
printf " %s\n" "---"
@@ -1866,7 +1870,6 @@ fi
18661870
#
18671871
ban_awkcmd="$(f_cmd gawk awk)"
18681872
ban_catcmd="$(f_cmd cat)"
1869-
ban_fw4cmd="$(f_cmd fw4)"
18701873
ban_grepcmd="$(f_cmd grep)"
18711874
ban_jsoncmd="$(f_cmd jsonfilter)"
18721875
ban_logcmd="$(f_cmd logger)"

net/banip/files/banip-service.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,8 @@ f_rmdir "${ban_errordir}"
2929

3030
# firewall/fw4 pre-check
3131
#
32-
if [ ! -x "${ban_fw4cmd}" ] || [ ! -x "/etc/init.d/firewall" ]; then
33-
f_log "err" "firewall/fw4 not found"
34-
elif ! /etc/init.d/firewall status >/dev/null 2>&1; then
35-
f_log "info" "firewall/fw4 is not running"
32+
if ! /etc/init.d/firewall status >/dev/null 2>&1; then
33+
f_log "info" "the main firewall is not running"
3634
fi
3735

3836
# init banIP nftables namespace
@@ -41,16 +39,14 @@ if [ "${ban_action}" != "reload" ] || ! "${ban_nftcmd}" list chain inet banIP pr
4139
f_nftinit "${ban_tmpfile}".init.nft
4240
fi
4341

44-
# handle downloads
42+
# start banIP processing
4543
#
4644
f_log "info" "start banIP download processes"
47-
if [ "${ban_allowlistonly}" = "1" ]; then
48-
ban_feed=""
49-
else
50-
f_getfeed
51-
fi
45+
f_getfeed
5246
[ "${ban_deduplicate}" = "1" ] && printf "\n" >"${ban_tmpfile}.deduplicate"
5347

48+
# handle downloads
49+
#
5450
cnt="1"
5551
for feed in allowlist ${ban_feed} blocklist; do
5652
# local feeds (sequential processing)

net/banip/files/banip.feeds

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -275,10 +275,12 @@
275275
"descr": "tor exit nodes"
276276
},
277277
"turris":{
278-
"url_4":"https://view.sentinel.turris.cz/greylist-data/greylist-latest.csv",
279-
"rule_4":"BEGIN{FS=\",\"}/^127\\./{next}/^(([1-9][0-9]{0,2}\\.){1}([0-9]{1,3}\\.){2}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)/{printf \"%s,\\n\",$1}",
278+
"url_4": "https://view.sentinel.turris.cz/greylist-data/greylist-latest.csv",
279+
"url_6": "https://view.sentinel.turris.cz/greylist-data/greylist-latest.csv",
280+
"rule_4": "BEGIN{FS=\",\"}/^127\\./{next}/^(([1-9][0-9]{0,2}\\.){1}([0-9]{1,3}\\.){2}(1?[0-9][0-9]?|2[0-4][0-9]|25[0-5])(\\/(1?[0-9]|2?[0-9]|3?[0-2]))?)/{printf \"%s,\\n\",$1}",
281+
"rule_6": "BEGIN{FS=\",\"}/^(([0-9A-f]{0,4}:){1,7}[0-9A-f]{0,4}:?(\\/(1?[0-2][0-8]|[0-9][0-9]))?)/{printf \"%s,\\n\",$1}",
280282
"chain": "in",
281-
"descr":"turris sentinel blocklist"
283+
"descr": "turris sentinel blocklist"
282284
},
283285
"uceprotect1":{
284286
"url_4": "http://wget-mirrors.uceprotect.net/rbldnsd-all/dnsbl-1.uceprotect.net.gz",

net/banip/files/banip.init

Lines changed: 18 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,24 @@ ban_funlib="/usr/lib/banip-functions.sh"
2020
ban_pidfile="/var/run/banip.pid"
2121
ban_lock="/var/run/banip.lock"
2222

23-
[ "${action}" = "boot" ] && "${ban_init}" running && exit 0
24-
{ [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ]; } && ! "${ban_init}" running && exit 0
25-
[ ! -r "${ban_funlib}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && exit 1
26-
[ -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; } && exit 1
27-
[ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; } && mkdir -p "${ban_lock}"
28-
{ [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] || [ "${action}" = "survey" ] || [ "${action}" = "lookup" ] || [ "${action}" = "status" ]; } && . "${ban_funlib}"
29-
[ ! -d "${ban_lock}" ] && { [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] || [ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; } && exit 1
23+
if [ -z "${IPKG_INSTROOT}" ]; then
24+
if [ "${action}" = "boot" ] && "${ban_init}" running; then
25+
exit 0
26+
elif { [ "${action}" = "stop" ] || [ "${action}" = "report" ] || [ "${action}" = "search" ] ||
27+
[ "${action}" = "survey" ] || [ "${action}" = "lookup" ]; } && ! "${ban_init}" running; then
28+
exit 0
29+
fi
30+
if [ ! -d "${ban_lock}" ] &&
31+
{ [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] ||
32+
[ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; }; then
33+
mkdir -p "${ban_lock}"
34+
elif [ -d "${ban_lock}" ] &&
35+
{ [ "${action}" = "boot" ] || [ "${action}" = "start" ] || [ "${action}" = "restart" ] ||
36+
[ "${action}" = "reload" ] || [ "${action}" = "lookup" ] || [ "${action}" = "search" ]; }; then
37+
exit 1
38+
fi
39+
. "${ban_funlib}"
40+
fi
3041

3142
boot() {
3243
: >"${ban_pidfile}"

0 commit comments

Comments
 (0)