-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrt.sh
More file actions
executable file
·39 lines (28 loc) · 810 Bytes
/
rt.sh
File metadata and controls
executable file
·39 lines (28 loc) · 810 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#!/usr/bin/env bash
progress=1
while true; do
if [ $progress -eq 1 ]; then
echo " \\"
fi
if [ $progress -eq 2 ]; then
echo " |"
fi
if [ $progress -eq 3 ]; then
echo " /"
fi
if [ $progress -eq 4 ]; then
echo " -"
progress=0
fi
progress=$[$progress+1]
if_list=`netstat -i | awk '{ if( NR != 1 && NR != 2 && index($0, "lo") == 0) {i = index($0, "\t"); print substr($0,1,5);}}'`
for if in $if_list; do
echo -ne "$if: "
ifconfig $if | grep "inet addr:" | awk '{ i = index($0, "inet addr:"); i+=10; ip = substr($0,i,length($0) - i); i = index( ip, " "); printf "%s - ", substr(ip,1,i); }'
ifconfig | grep $if | awk '{ i = index($0, "HWaddr "); i+=7; printf "%s\n", substr($0,i,length($0) - i);}'
done
echo
route -n
sleep 1
clear
done