1567f8fa0faaada4fea414d2d10e58bd8f34772d
[platform/core/connectivity/net-config.git] / resources / opt / etc / dump.d / module.d / network_log_dump.sh
1 #!/bin/sh
2 PATH=/bin:/usr/bin:/sbin:/usr/sbin
3
4 #--------------------------------------
5 #   network
6 #--------------------------------------
7
8 # not allow to use relative path
9 if [[ $1 == *"../"* ]]
10 then
11         exit -1
12 fi
13
14 export DISPLAY=:0.0
15 NETWORK_ORG=/opt/usr/data/network
16 NETWORK_DEBUG=$1/network
17
18 /bin/mkdir -p ${NETWORK_DEBUG}
19
20 /sbin/ifconfig > ${NETWORK_DEBUG}/ifconfig
21 /bin/netstat -na > ${NETWORK_DEBUG}/netstat
22 /sbin/route -n > ${NETWORK_DEBUG}/route
23 /bin/cat /proc/net/wireless > ${NETWORK_DEBUG}/wireless
24 /bin/cat /etc/resolv.conf > ${NETWORK_DEBUG}/resolv.conf
25 /usr/bin/vconftool get memory/dnet >> ${NETWORK_DEBUG}/status
26 /usr/bin/vconftool get memory/wifi >> ${NETWORK_DEBUG}/status
27 /usr/bin/vconftool get file/private/wifi >> ${NETWORK_DEBUG}/status
28 /usr/bin/vconftool get db/wifi >> ${NETWORK_DEBUG}/status
29 /sbin/ifconfig -a > ${NETWORK_DEBUG}/ifconfig
30 /bin/mv ${NETWORK_ORG}/tcpdump*.pcap* $1/../
31 /bin/tar -czf ${NETWORK_DEBUG}/network.tar.gz -C ${NETWORK_ORG} .