2010-03-16 22:02:27 +00:00
|
|
|
_add_etc_network_interfaces() {
|
2009-10-04 19:43:48 +00:00
|
|
|
echo '** Network interface configuration:' >&3
|
2009-11-17 01:18:56 +00:00
|
|
|
# Hide passwords/keys
|
2009-11-21 18:22:26 +00:00
|
|
|
awk '$1 ~ /key|pass|^wpa-(anonymous|identity|phase|pin|private|psk)/ { gsub(".", "*", $2); }
|
2009-11-17 01:18:56 +00:00
|
|
|
$1 == "ethtool-wol" { gsub(".", "*", $3); }
|
2009-11-21 18:22:26 +00:00
|
|
|
!/^[[:space:]]*\#/ { print; }
|
2009-11-17 01:18:56 +00:00
|
|
|
' </etc/network/interfaces >&3
|
2009-10-04 19:43:48 +00:00
|
|
|
echo >&3
|
2010-03-16 22:02:27 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
add_network() {
|
|
|
|
yesno "Include network configuration and status from this computer? " nop
|
|
|
|
test $REPLY = yep || return 0
|
|
|
|
|
|
|
|
_add_etc_network_interfaces
|
2009-10-04 19:43:48 +00:00
|
|
|
echo '** Network status:' >&3
|
|
|
|
if command -v ip >/dev/null; then
|
|
|
|
echo '*** IP interfaces and addresses:' >&3
|
|
|
|
ip address show >&3
|
|
|
|
echo >&3
|
|
|
|
fi
|
|
|
|
echo '*** Device statistics:' >&3
|
|
|
|
cat /proc/net/dev >&3
|
|
|
|
echo >&3
|
|
|
|
if command -v netstat >/dev/null; then
|
|
|
|
echo '*** Protocol statistics:' >&3
|
|
|
|
netstat -s >&3 || true
|
|
|
|
echo >&3
|
|
|
|
fi
|
|
|
|
echo >&3
|
|
|
|
}
|
|
|
|
|
|
|
|
ask_network() {
|
|
|
|
test $same_system = yep || return 0
|
|
|
|
yesno "Include network configuration from this computer? " nop
|
|
|
|
test $REPLY = yep || return 0
|
|
|
|
|
2010-03-16 22:02:27 +00:00
|
|
|
_add_etc_network_interfaces
|
2009-10-04 19:43:48 +00:00
|
|
|
}
|