upload tizen1.0 source
[kernel/linux-2.6.36.git] / debian / templates / image.plain.bug / include-network
1 _add_etc_network_interfaces() {
2   echo '** Network interface configuration:' >&3
3   # Hide passwords/keys
4   awk '$1 ~ /key|pass|^wpa-(anonymous|identity|phase|pin|private|psk)/ { gsub(".", "*", $2); }
5        $1 == "ethtool-wol" { gsub(".", "*", $3); }
6        !/^[[:space:]]*\#/ { print; }
7       ' </etc/network/interfaces >&3
8   echo >&3
9 }
10
11 add_network() {
12   yesno "Include network configuration and status from this computer? " nop
13   test $REPLY = yep || return 0
14
15   _add_etc_network_interfaces
16   echo '** Network status:' >&3
17   if command -v ip >/dev/null; then
18     echo '*** IP interfaces and addresses:' >&3
19     ip address show >&3
20     echo >&3
21   fi
22   echo '*** Device statistics:' >&3
23   cat /proc/net/dev >&3
24   echo >&3
25   if command -v netstat >/dev/null; then
26     echo '*** Protocol statistics:' >&3
27     netstat -s >&3 || true
28     echo >&3
29   fi
30   echo '*** Device features:' >&3
31   for dir in /sys/class/net/*; do
32     echo -n "${dir##*/}: " >&3
33     cat "$dir"/features >&3
34   done
35   echo >&3
36 }
37
38 ask_network() {
39   test $same_system = yep || return 0
40   yesno "Include network configuration from this computer? " nop
41   test $REPLY = yep || return 0
42
43   _add_etc_network_interfaces
44 }