[RP-PPPoE] bug-report: scripts /etc/ppp/firewall-* (error iptables invoke)

Andrej Antonov polymorphm at gmail.com
Mon Sep 29 14:54:21 EDT 2014


good day again! :)

may be next hack is better:



if iptables -w -nL >/dev/null 2>&1
then
  iptables_wrap () {
    iptables -w "$@"
  }
else
  iptables_wrap () {
    flock -x /run/iptables.lock iptables "$@"
  }
  touch /run/iptables.lock
fi



thanks!

On 17 February 2014 19:13, Andrej Antonov <polymorphm at gmail.com> wrote:
> good day!
>
> files /etc/ppp/firewall-* (various scripts) --- use command: iptables ...
>
> but MUST use command: iptables -w ...
>
> utility iptables (without option -w) -- may exit with error if other
> parallel script is running.
>
>
> additional info (for implement):
>
> keyword ``-w`` may not present in not-modern linux-distributives.
>
> as solution -- may be need use wrap-function [iptables_wrap] in
> scripts -- like in this example:
>
> if iptables -w -nL >/dev/null 2>&1
> then
>   iptables_wrap () {
>     iptables -w "$@"
>   }
> else
>   iptables_wrap () {
>     iptables "$@"
>   }
> fi
>
>
>
>
> thanks!


More information about the RP-PPPoE mailing list