if [ -n "$icmpIface" ] && ! str_contains_word "$usedChainsList" 'OUTPUT'; then
usedChainsList="$usedChainsList OUTPUT"
fi
case $insertOption in
insert|-i|-I) insertOption='-I';;
@ -230,27 +232,27 @@ load_package_config() {
if dnsmasq -v 2>/dev/null | grep -q 'no-ipset' || ! dnsmasq -v 2>/dev/null | grep -q -w 'ipset'; then
unset dnsmasqIpsetSupported
if [ -n "$dnsmasqIpsetSupported" ]; then
errorSummary="${errorSummary}$_ERROR_: Resolver ipset support (dnsmasq.ipset) is enabled in $packageName, but DNSMASQ ipsets are not supported on this system!\\n"
errorSummary="${errorSummary}${_ERROR_}: Resolver ipset support (dnsmasq.ipset) is enabled in $packageName, but DNSMASQ ipsets are not supported on this system!\\n"
fi
fi
if ! ipset help hash:net >/dev/null 2>&1; then
unset ipsetSupported
if [ -n "$dnsmasqIpsetSupported" ]; then
errorSummary="${errorSummary}$_ERROR_: DNSMASQ ipsets are supported, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n"
errorSummary="${errorSummary}${_ERROR_}: DNSMASQ ipsets are supported, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n"
unset dnsmasqIpsetSupported
fi
if [ "$destIpset" -ne 0 ]; then
errorSummary="${errorSummary}$_ERROR_: Destination ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n"
errorSummary="${errorSummary}${_ERROR_}: Destination ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n"
destIpset=0
fi
if [ "$srcIpset" -ne 0 ]; then
errorSummary="${errorSummary}$_ERROR_: Source ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n"
errorSummary="${errorSummary}${_ERROR_}: Source ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:net' type!\\n"
srcIpset=0
fi
fi
if ! ipset help hash:mac >/dev/null 2>&1; then
if [ "$srcIpset" -ne 0 ]; then
errorSummary="${errorSummary}$_ERROR_: Source ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:mac' type!\\n"
errorSummary="${errorSummary}${_ERROR_}: Source ipset support is enabled in $packageName, but ipset is either not installed or installed ipset does not support 'hash:mac' type!\\n"
srcIpset=0
fi
fi
@ -262,34 +264,44 @@ is_enabled() {
load_package_config
if [ "$serviceEnabled" -eq 0 ]; then
if [ "$1" = 'on_start' ]; then
output "$packageName is currently disabled.\\n"
output "Run the following commands before starting service again:\\n"
output "uci set $packageName.config.enabled='1'; uci commit;\\n"
errorSummary="${errorSummary}${_ERROR_}: ${packageName} is currently disabled.\\n"
errorSummary="${errorSummary}Enable ${packageName} from WebUI or run the following commands:\\n"
errorSummary="${errorSummary}uci set $packageName.config.enabled='1'; uci commit $packageName;\\n"