-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

On 10/10/2016 11:09 AM, Vieri Di Paola wrote:
> 
> 
> 
> 
> ----- Original Message -----
> 
>> From: Tom Eastep <[email protected]> On 10/10/2016 08:48 AM,
>> Vieri Di Paola wrote:
> 
>>> Hi,
>>> 
>>> Is there a way to pass variables defined in "params" to the
>>> child processes spawned by SHELL or BEGIN SHELL?
>>> 
>>> I'd like to read a variable set in "params" within "SHELL".>
>> Yes -- just export those variables in your 'init' extension
>> script.
> 
> 
> I'm not sure I understand.
> 
> # cat /etc/shorewall/init export TEST_VAR=10.215.144.48
> 
> If I add the following to 'routes' then the condition is not met
> (variable is empty or undefined):
> 
> ?BEGIN SHELL if [ ${#TEST_VAR} -gt 0 ]; then echo "main
> \$TEST_VAR      -       \$IF2" fi

My bad -- you need to export in the params file itself. Then this also
works:

?shell echo "${var}"

- -Tom
- -- 
Tom Eastep        \ When I die, I want to go like my Grandfather who
Shoreline,         \ died peacefully in his sleep. Not screaming like
Washington, USA     \ all of the passengers in his car
http://shorewall.net \________________________________________________
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: GPGTools - http://gpgtools.org

iQIcBAEBCAAGBQJX+96sAAoJEJbms/JCOk0Q/YEQAJDkCY/1OatcgskK9hlAKpAM
u53U27wtJVuwFRbrIY12VOB89kiPtYZT28JMvHTq8RYEuWXKVwrcQgv9VD+OXlFS
wecmPNbVRGLz/HPwi/U/6YOLFNd6E4rYKqB0/wX5ZCbcyuapy80/xEQ8A4UYa/oY
IG/MXdKmGTTmTefFCkNnsIpQSUU/8aLueNzpEcv7gLG3moyU+uq8Vs9jxISizgY3
dI3g8K24clJ2PjURcoOdtyopN9lNfqLj+9o2eMcmNfk070av/ilPMXyqmyk2VdqF
0aA8uo7X9KZI2XSrG360l0wpxMCCfWgmQenSc58M8R6WGX2qOXxDZoYy/NQARudF
fedcAeicK9NJJQfWY59K/s/QPQT4M9COaWcAqz7oxLJK3j70WZ8xBwlyX5pmx4oV
Ufi+/EmXQ+KVeH1KCk209Uniq51H8/WNYiuDCU9wssyV+jrUV7d4ZRlUPkRIyT1h
6YMAKvb27yIAP/wQLTwqY4Ui23Jn9MIeYhnY8C4rNSRFKexJ6Mjz0zNq6DBOuVFW
BiKCQ7r3YsQdKlOl7KvILs+AeE7XHTj5lUB1vsuJaH5TKg7XeDJdZvS7OWDLJx5h
YKacL3TFp/AXMe63FP1dBjywHSJ4/X6sFYEGcAICf/p7n4sXFgHmGuE9sxTb2aiH
sq7f7L0vxSe29BX0P19s
=BSVg
-----END PGP SIGNATURE-----

------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most 
engaging tech sites, SlashDot.org! http://sdm.link/slashdot
_______________________________________________
Shorewall-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/shorewall-users

Reply via email to