---------- Forwarded message ----------
From: Tom Eastep <[email protected]>
To: [email protected]
Cc:
Date: Wed, 21 Oct 2015 19:02:22 -0700
Subject: Re: [Shorewall-users] Providers: ppp0/1/2 interface detected from
IP address
On 10/21/2015 6:09 AM, Marcelo Bello wrote:

>
> The only thing you are missing is that you can put the script logic in the
params file itself. That file is always processed by $SHOREWALL_SHELL.

-Tom


Ok, thanks Tom.

Just to close this topic, I solved the issue with the following script
added to the params file:

ADSL_IFACE=$(pidfile=/var/run/ppp-adsl.pid && if test -e $pidfile; then
echo `awk '$1 ~ /ppp[0-9]+/' $pidfile`; else echo ppp0; fi)
ADSL_IFACE=$(if test -n "$ADSL_IFACE"; then echo $ADSL_IFACE; else echo
ppp0; fi)

I am not very familiar with bash scripting but I tested the above and it
works well, and it ensures that the default value of "ppp0" is used if the
pid file does not exist or if the pid file for some reason does not contain
the interface name.

The script above depends on the option "linkname XXX" being set on the pppd
conf file (in this example, "linkname adsl" so that the file ppp-adsl.pid
is created).

Last but not least, I also added "shorewall restart" to the post-up script.

Best regards,

Marcelo
------------------------------------------------------------------------------
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to