From 0f72f2419a70c1779ea9aa69cdd945c273aded46 Mon Sep 17 00:00:00 2001 From: Christoph Date: Wed, 4 Sep 2019 17:40:30 +0200 Subject: [PATCH] Some monor changes.. --- ip6t-firewall-gateway | 14 ++++++++++++++ ipt-firewall-gateway | 13 +++++++++++++ 2 files changed, 27 insertions(+) diff --git a/ip6t-firewall-gateway b/ip6t-firewall-gateway index cd1a369..4ccf2a7 100755 --- a/ip6t-firewall-gateway +++ b/ip6t-firewall-gateway @@ -99,6 +99,20 @@ else source $conf_post_declarations fi +# --- +# - IPv6 Addresses Gateway +# --- + +#_ips="$(ip -6 a | grep "inet6 " | awk '{print$2}' | cut -d'/' -f1)" +_ips="$(ip -6 a | grep "inet6 " | grep -v -E "(\s+fd|\s+fe80)" | awk '{print$2}' | cut -d'/' -f1)" + +declare -a gateway_ipv6_address_arr=() +if [[ -n "$_ips" ]] ; then + for _ip in $_ips ; do + gateway_ipv6_address_arr+=("$_ip") + done +fi + echo if $terminal ; then diff --git a/ipt-firewall-gateway b/ipt-firewall-gateway index c8e1b2c..accb30b 100755 --- a/ipt-firewall-gateway +++ b/ipt-firewall-gateway @@ -99,6 +99,19 @@ else source $conf_post_declarations fi +# --- +# - IPv4 Addresses Gateway +# --- + +_ips="$(ip -4 a | grep "inet " | awk '{print$2}' | cut -d'/' -f1)" + +declare -a gateway_ipv4_address_arr=() +if [[ -n "$_ips" ]] ; then + for _ip in $_ips ; do + gateway_ipv4_address_arr+=("$_ip") + done +fi + echo if $terminal ; then