File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change 77MOTD_DISABLE="clear"
88ONE_WIRE=""
99HIDE_IP_PATTERN="^dummy0|^lo|^docker|^hassio|^br-|^veth|^vnet|^virbr"
10+ HIDE_LOCAL_IPV6="true"
1011PRIMARY_INTERFACE="$(ip route | grep '^default' | sed "s/.*dev //" | cut -d" " -f1)"
1112PRIMARY_DIRECTION="rx"
1213STORAGE=/dev/sda1
Original file line number Diff line number Diff line change 1212THIS_SCRIPT=" header"
1313MOTD_DISABLE=" "
1414HIDE_IP_PATTERN=" ^dummy0|^lo|^docker|^hassio|^br-|^veth|^vnet|^virbr"
15+ HIDE_LOCAL_IPV6=" true"
1516
1617# Read image configuration
1718[[ -f /etc/armbian-image-release ]] && . /etc/armbian-image-release
@@ -85,6 +86,9 @@ function get_ip_addresses() {
8586 ipv4=$( echo " ${ipv4} " | cut -d' /' -f1)
8687 ipv4=$( echo " ${ipv4} " | awk ' !x[$0]++' )
8788 ipv6=$( ip -6 addr show dev " ${intf} " )
89+ if [[ " ${HIDE_LOCAL_IPV6} " == true ]]; then
90+ ipv6=$( ip -6 addr show dev " ${intf} " | grep -v fe80)
91+ fi
8892 ipv6=$( echo " ${ipv6} " | grep -v " ${intf} :avahi" )
8993 ipv6=$( echo " ${ipv6} " | awk ' /inet6/ {print $2}' )
9094 ipv6=$( echo " ${ipv6} " | cut -d' /' -f1)
@@ -206,9 +210,11 @@ if [[ -n "${wan_ip6_address}" && "${ipv6s}" == *${wan_ip6_address}* ]]; then
206210 ipv6s=$( echo $ipv6s | sed " s/" ${wan_ip6_address} " //g" | xargs )
207211fi
208212
209- if [[ -n ${ipv6s} ]]; then
213+ if [[ -n ${ipv6s} || -n ${wan_ip6_address} ]]; then
210214 all_ip6_address=" IPv6: "
211- all_ip6_address+=" \x1B[96m${ipv6s// / , } \x1B[0m "
215+ if [[ -n ${ipv6s} ]]; then
216+ all_ip6_address+=" \x1B[96m${ipv6s// / , } \x1B[0m "
217+ fi
212218 if [[ -n ${wan_ip6_address} ]]; then
213219 all_ip6_address+=" \x1B[93m(WAN)\x1B[0m \x1B[95m${wan_ip6_address} \x1B[0m "
214220 fi
You can’t perform that action at this time.
0 commit comments