-
Notifications
You must be signed in to change notification settings - Fork 3
/
check.sh
executable file
·75 lines (54 loc) · 1.27 KB
/
check.sh
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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
#!/bin/bash
set -eu
set -o pipefail
LANG=C
IFACE=wg0
echo "Tunables:"
for i in /proc/sys/net/ipv4/{icmp_echo_ignore_all,icmp_echo_ignore_broadcasts,icmp_msgs_burst,icmp_msgs_per_sec,icmp_ratelimit,ping_group_range,ip_forward}
do
echo -e "$i\t = $(cat $i)"
done
echo ""
echo "Interface tunables:"
for i in /proc/sys/net/ipv4/conf/$IFACE/{forwarding,rp_filter}
do
echo -e "$i\t = $(cat $i)"
done
echo ""
echo "Address:"
ip address show $IFACE
echo ""
echo "Link:"
ip link show $IFACE
echo ""
echo "Routes:"
ip route list dev $IFACE
while IFS=$'\t' read -r iface dest gw flags refcount use metric mask mtu window rtt;
do
if [[ "$iface" != "$IFACE" ]]; then
continue
fi
echo -e "$iface\t$dest/$mask via $gw f:$flags metric:$metric mtu:$mtu"
done < /proc/net/route
echo ""
echo "Modules:"
while IFS=' ' read -r kname ksize kcount kdeps klive khex;
do
declare found=false
if [[ "$kname" = "usbip_core" ]]; then
found=true
fi
if [[ "$kname" = "usbip_host" ]]; then
found=true
fi
if [ "$found" = false ]; then
continue
fi
echo -e "$klive\t$kname\t($kdeps)"
done < /proc/modules
echo ""
echo "systemd: usbipd daemon active:"
systemctl is-active usbipd
echo ""
echo "usbip TCP port 3240 listening:"
ss --numeric --tcp --listening src :3240