/etc/firewall-portal.user returns 1

Device: GL-MT3000
Firmware: 4.7.0 release 3

Disclamer: I'm not advanced network engineer... I try to setup vpn manually and suprized, that /etc/init.d/firewall restart returns 1. Try to solve it. If it's not a problem, close the topic.

Problem: /etc/init.d/firewall restart returns 1.
Reason:

config include 'portal_ttl'
        option path '/etc/firewall-portal.user'
        option reload '1'

script '/etc/firewall-portal.user' returns 1.

/etc/firewall-portal.user:

iptables -t mangle -N PORTAL_TTL 2>/dev/null
iptables -t mangle -F PORTAL_TTL
iptables -t mangle -D POSTROUTING -o apclix0 -j PORTAL_TTL 2>/dev/null
ip6tables -t mangle -N PORTAL_TTL 2>/dev/null
ip6tables -t mangle -F PORTAL_TTL
ip6tables -t mangle -D POSTROUTING -o apclix0 -j PORTAL_TTL 2>/dev/null

better:

iptables -t mangle -N PORTAL_TTL 2>/dev/null
iptables -t mangle -F PORTAL_TTL
if iptables -t mangle -C POSTROUTING -o apclix0 -j PORTAL_TTL 2>/dev/null; then
    iptables -t mangle -D POSTROUTING -o apclix0 -j PORTAL_TTL 2>/dev/null
fi
ip6tables -t mangle -N PORTAL_TTL 2>/dev/null
ip6tables -t mangle -F PORTAL_TTL
if ip6tables -t mangle -C POSTROUTING -o apclix0 -j PORTAL_TTL 2>/dev/null; then
    ip6tables -t mangle -D POSTROUTING -o apclix0 -j PORTAL_TTL 2>/dev/null
fi

Now it returns 0.

Hello,

Thank you very much for your optimization suggestions.

I will submit it to the R&D for evaluation whether it is necessary to add this pre-execution judgment.