vpn-policy-routing: update config file, support PROCD_RELOAD_DELAY

Signed-off-by: Stan Grishin <stangri@melmac.net>
This commit is contained in:
Stan Grishin 2021-02-23 01:12:17 +00:00
parent 9543f72c77
commit eced9ee669
3 changed files with 27 additions and 18 deletions

View file

@ -5,7 +5,7 @@ include $(TOPDIR)/rules.mk
PKG_NAME:=vpn-policy-routing PKG_NAME:=vpn-policy-routing
PKG_VERSION:=0.3.2 PKG_VERSION:=0.3.2
PKG_RELEASE:=10 PKG_RELEASE:=12
PKG_LICENSE:=GPL-3.0-or-later PKG_LICENSE:=GPL-3.0-or-later
PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net> PKG_MAINTAINER:=Stan Grishin <stangri@melmac.net>

View file

@ -6,10 +6,10 @@ config vpn-policy-routing 'config'
option dest_ipset '0' option dest_ipset '0'
option resolver_ipset 'dnsmasq.ipset' option resolver_ipset 'dnsmasq.ipset'
option ipv6_enabled '0' option ipv6_enabled '0'
list supported_interface ''
list ignored_interface 'vpnserver wgserver' list ignored_interface 'vpnserver wgserver'
option boot_timeout '30' option boot_timeout '30'
option iptables_rule_option 'append' option iptables_rule_option 'append'
option procd_reload_delay '1'
option webui_enable_column '0' option webui_enable_column '0'
option webui_protocol_column '0' option webui_protocol_column '0'
option webui_chain_column '0' option webui_chain_column '0'

View file

@ -41,14 +41,15 @@ readonly __FAIL__='\033[0;31m[\xe2\x9c\x97]\033[0m'
readonly _ERROR_='\033[0;31mERROR\033[0m' readonly _ERROR_='\033[0;31mERROR\033[0m'
readonly _WARNING_='\033[0;33mWARNING\033[0m' readonly _WARNING_='\033[0;33mWARNING\033[0m'
# declare gatewaySummary errorSummary warningSummary gatewaySummary=''; errorSummary=''; warningSummary='';
# declare serviceEnabled verbosity strictMode serviceEnabled=''; verbosity=''; strictMode='';
# declare wanTableID wanMark fwMask wanTableID=''; wanMark=''; fwMask='';
# declare ipv6Enabled srcIpset destIpset resolverIpset ipv6Enabled=''; srcIpset=''; destIpset=''; resolverIpset='';
# declare wanIface4 wanIface6 ifaceMark ifaceTableID wanIface4=''; wanIface6=''; ifaceMark=''; ifaceTableID='';
# declare ifAll ifSupported ignoredIfaces supportedIfaces icmpIface ifAll=''; ifSupported=''; ignoredIfaces=''; supportedIfaces=''; icmpIface='';
# declare wanGW4 wanGW6 bootTimeout insertOption wanGW4=''; wanGW6=''; bootTimeout=''; insertOption='';
# declare webuiChainColumn webuiShowIgnore dnsmasqIpsetSupported webuiChainColumn=''; webuiShowIgnore=''; dnsmasqIpsetSupported='';
procdReloadDelay='';
usedChainsList='PREROUTING' usedChainsList='PREROUTING'
ipsetSupported='true' ipsetSupported='true'
configLoaded='false' configLoaded='false'
@ -203,6 +204,7 @@ load_package_config() {
config_get supportedIfaces 'config' 'supported_interface' config_get supportedIfaces 'config' 'supported_interface'
config_get bootTimeout 'config' 'boot_timeout' '30' config_get bootTimeout 'config' 'boot_timeout' '30'
config_get insertOption 'config' 'iptables_rule_option' 'append' config_get insertOption 'config' 'iptables_rule_option' 'append'
config_get procdReloadDelay 'config' 'procd_reload_delay' '0'
config_get_bool webuiChainColumn 'config' 'webui_chain_column' '0' config_get_bool webuiChainColumn 'config' 'webui_chain_column' '0'
config_get_bool webuiShowIgnore 'config' 'webui_show_ignore_target' '0' config_get_bool webuiShowIgnore 'config' 'webui_show_ignore_target' '0'
config_foreach append_chains_targets 'policy' config_foreach append_chains_targets 'policy'
@ -991,6 +993,11 @@ service_triggers() {
local n local n
is_enabled || return 1 is_enabled || return 1
if [ "$procdReloadDelay" -gt 0 ] && [ "$procdReloadDelay" -lt 100 ]; then
# shellcheck disable=SC2034
PROCD_RELOAD_DELAY=$(( procdReloadDelay * 1000 ))
fi
procd_open_validate procd_open_validate
validate_config validate_config
validate_policy validate_policy
@ -1135,25 +1142,27 @@ support() {
validate_config() { validate_config() {
uci_validate_section "${packageName}" config "${1}" \ uci_validate_section "${packageName}" config "${1}" \
'enabled:bool:0' \ 'enabled:bool:0' \
'verbosity:range(0,2):1' \
'strict_enforcement:bool:1' \ 'strict_enforcement:bool:1' \
'ipv6_enabled:bool:0' \
'src_ipset:bool:0' \ 'src_ipset:bool:0' \
'dest_ipset:bool:0' \ 'dest_ipset:bool:0' \
'resolver_ipset::or("", "none", "dnsmasq.ipset")' \ 'resolver_ipset::or("", "none", "dnsmasq.ipset")' \
'ipv6_enabled:bool:0' \ 'verbosity:range(0,2):1' \
'supported_interface:list(string)' \ 'wan_tid:integer:201' \
'wan_fw_mark:hex(8)' \
'fw_mask:hex(8)' \
'icmp_interface:string' \
'ignored_interface:list(string)' \ 'ignored_interface:list(string)' \
'supported_interface:list(string)' \
'boot_timeout:integer:30' \ 'boot_timeout:integer:30' \
'iptables_rule_option:or("", "append", "insert")' \ 'iptables_rule_option:or("", "append", "insert")' \
'procd_reload_delay:integer:0' \
'webui_enable_column:bool:0' \ 'webui_enable_column:bool:0' \
'webui_protocol_column:bool:0' \ 'webui_protocol_column:bool:0' \
'webui_supported_protocol:list(string)' \ 'webui_supported_protocol:list(string)' \
'webui_chain_column:bool:0' \ 'webui_chain_column:bool:0' \
'webui_sorting:bool:1' \ 'webui_sorting:bool:1' \
'icmp_interface:string' \ 'webui_show_ignore_target:bool:0'
'wan_tid:integer:201' \
'wan_fw_mark:hex(8)' \
'fw_mask:hex(8)'
} }
# shellcheck disable=SC2120 # shellcheck disable=SC2120