forked from Nachtzuster/BirdNET-Pi
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathextra_info.sh
More file actions
executable file
·70 lines (68 loc) · 2.51 KB
/
extra_info.sh
File metadata and controls
executable file
·70 lines (68 loc) · 2.51 KB
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
#!/usr/bin/env bash
#Display network info for phpsysinfo
echo "........................................IPs....................................."
echo "LAN IP: $(hostname -I|cut -d' ' -f1)"
echo "Public IP: $(curl -s4 ifconfig.co)"
if which vcgencmd &>/dev/null ; then
echo "..................................\`vcgencmd stats\`.............................."
sudo -u$USER vcgencmd get_throttled
hex=$(sudo -u$USER vcgencmd get_throttled | cut -d'x' -f2)
binary=$(echo "ibase=16;obase=2;$hex" | bc)
echo "Binary: $binary"
revbinary=$(echo $binary | rev)
if echo $binary | grep 1; then
echo "ISSUES DETECTED"
if [ ${revbinary:0:1} -eq 1 ] &>/dev/null; then
message="Under-voltage detected"
echo "$message"
dmesg -H | grep -i voltage
fi
if [ ${revbinary:1:1} -eq 1 ] &>/dev/null; then
message="Arm frequency capped"
echo "$message"
dmesg -H | grep -i frequen
fi
if [ ${revbinary:2:1} -eq 1 ] &>/dev/null; then
message="Currently Throttled"
echo "$message"
dmesg -H | grep -i throttl
fi
if [ ${revbinary:3:1} -eq 1 ] &>/dev/null; then
message="Soft temperatue limit active"
echo "$message"
dmesg -H | grep -i temperature
fi
if [ ${revbinary:16:1} -eq 1 ] &>/dev/null; then
message="Under-voltage has occurred"
echo "$message"
dmesg -H | grep -i voltage
fi
if [ ${revbinary:17:1} -eq 1 ] &>/dev/null; then
message="Arm frequency capping has occurred"
echo "$message"
dmesg -H | grep -i frequen
fi
if [ ${revbinary:18:1} -eq 1 ] &>/dev/null; then
message="Throttling has occurred"
echo "$message"
dmesg -H | grep -i throttl
fi
if [ ${revbinary:19:1} -eq 1 ] &>/dev/null; then
message="Soft temperature limit has occurred"
echo "$message"
dmesg -H | grep -i temperature
fi
fi
echo "....................................Clock Speeds................................"
for i in arm core h264 isp v3d uart pwm emmc pixel vec hdmi dpi; do
echo -e "${i}:\t$(sudo -u$USER vcgencmd measure_clock ${i})"
done
echo "........................................Volts..................................."
for i in core sdram_c sdram_i sdram_p; do
echo -e "${i}:\t$(sudo -u$USER vcgencmd measure_volts ${i})"
done
fi
echo ".....................................Caddyfile.................................."
cat /etc/caddy/Caddyfile
echo ".................................... Crontab...................................."
cat /etc/crontab | grep -ve '^#'