mirror of
https://github.com/unraid/webgui.git
synced 2025-12-31 06:30:10 -06:00
14 lines
728 B
Bash
Executable File
14 lines
728 B
Bash
Executable File
#!/bin/bash
|
|
nets=()
|
|
while IFS='\n' read -r net; do
|
|
net=${net%/*}
|
|
net4=$(ip -br -4 addr show scope global to $net 2>/dev/null | awk '$1 !~ "^shim" {print $1}'|tr '\n' ',' | sed 's/,$//')
|
|
[[ -n $net4 ]] && nets+=("$net4 = $net;")
|
|
done <<< $(ip -br -4 addr show scope global | awk '/^(br|bond|eth|wlan|wg)[0-9]+(\.[0-9]+)?/ {print $3}' | uniq -d)
|
|
|
|
while IFS=$'\n' read -r net; do
|
|
net=${net%/*}
|
|
net6=$(ip -br -6 addr show scope global -temporary -deprecated to $net 2>/dev/null | awk '$1 !~ "^shim" {print $1}'|tr '\n' ',' | sed 's/,$//')
|
|
[[ -n $net6 ]] && nets+=("$net6 = $net;")
|
|
done <<< $(ip -br -6 addr show scope global -temporary -deprecated | awk '/^(br|bond|eth|wlan|wg)[0-9]+(\.[0-9]+)?/ {print $3}' | uniq -d)
|