diff options
Diffstat (limited to 'ipmasq/rules/A01interfaces_ipsec.def')
-rw-r--r-- | ipmasq/rules/A01interfaces_ipsec.def | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/ipmasq/rules/A01interfaces_ipsec.def b/ipmasq/rules/A01interfaces_ipsec.def new file mode 100644 index 0000000..484fb9e --- /dev/null +++ b/ipmasq/rules/A01interfaces_ipsec.def @@ -0,0 +1,23 @@ +# You should not edit this file. Instead, create a file with the same +# name as this one, but with a .rul extension instead of .def. The +# .rul file will override this one. +# +# However, any changes you make to this file will be preserved. + +# find IPsec interface names, and separate them from INTERNAL +IPSEC=$(enumerate-if | sort -u | grep ipsec) +if [ -n "$IPSEC" ]; then + for i in $IPSEC; do + INTERNAL=$(echo $INTERNAL | sed -e "s/\( *\|^\)$i\( *\|$\)/\1/") + done +fi + +# remove interfaces that don't have networks attached to them +if [ -n "$IPSEC" ]; then + for i in $IPSEC; do + nm=$(nmofif $i) + if [ -z "${nm}" ]; then + IPSEC=$(echo $IPSEC | sed -e "s/\( *\|^\)$i\( *\|$\)/\1/") + fi + done +fi |