From ccf7d7a81dc5950278b36113756ccd446be95dcf Mon Sep 17 00:00:00 2001 From: Christoph Date: Tue, 16 May 2017 13:53:32 +0200 Subject: [PATCH] New net-tools 'ifconfig' command output has change. So 'ifconfig' is replaced by 'ip a'. --- conf/main_ipv4.conf.sample | 6 +++++- conf/main_ipv6.conf.sample | 6 +++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/conf/main_ipv4.conf.sample b/conf/main_ipv4.conf.sample index be174aa..b4bbda7 100644 --- a/conf/main_ipv4.conf.sample +++ b/conf/main_ipv4.conf.sample @@ -8,7 +8,11 @@ # - IPv4 Addresses Gateway # --- declare -a gateway_ipv4_address_arr -read -a gateway_ipv4_address_arr <<<$(ifconfig | grep "inet Ad" | awk '{print$2}' | cut -d':' -f2) + +_ips="$(ip a | grep "inet " | awk '{print$2}' | cut -d'/' -f1)" +for _ip in $_ips ; do + gateway_ipv4_address_arr+=("$_ip") +done # ============= diff --git a/conf/main_ipv6.conf.sample b/conf/main_ipv6.conf.sample index c92659c..46fa5c2 100644 --- a/conf/main_ipv6.conf.sample +++ b/conf/main_ipv6.conf.sample @@ -8,7 +8,11 @@ # - IPv6 Addresses Gateway # --- declare -a gateway_ipv6_address_arr -read -a gateway_ipv6_address_arr <<<$(ifconfig | grep "inet6-Ad" | awk '{print$2}'| cut -d'/' -f1) + +_ips="$(ip a | grep "inet6 " | awk '{print$2}' | cut -d'/' -f1)" +for _ip in $_ips ; do + gateway_ipv6_address_arr+=("$_ip") +done # =============