On 6/8/20 1:04 PM, PGNet Dev wrote: > i've set > > /init > DYN_IP=$( dig A dyn.example.com @1.1.1.1 +short 2>/dev/null ) > > then use > > %{DYN_IP} > > in my SW configs, e.g. in /rules. > > if I want to add a fallback value, what's the correct syntax/usage? > > in fool_sm config, e.g., I use the form > > checkip=${SW_ETH0_GATEWAY:-1.2.3.4} > > where "SW_ETH0_GATEWAY" is an internal var. > > with the dynamic addressvariable, DYN_IP > > is it safe/valid to 'include' the fallback in the var defintion in /init as > > DYN_IP=${ $( dig A dyn.example.com @1.1.1.1 +short 2>/dev/null ) : > -1.2.3.4 } > > of course, using the *right* (???) syntax ..., and continue to use just > > %{DYN_IP} > > ? > > or, do I need to use > > %{DYN_IP:-1.2.3.4} > > or somesuch throughout? >
Shorewall doesn't support the latter syntax so you will have to assign the default in /init -Tom -- Tom Eastep \ Q: What do you get when you cross a mobster Shoreline, \ with an international standard? Washington, USA \ A: Someone who makes you an offer you http://shorewall.org \ can't understand \________________________________________
signature.asc
Description: OpenPGP digital signature
_______________________________________________ Shorewall-users mailing list Shorewall-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/shorewall-users