slitaz-arm view tools/example.cgi @ rev 219

dot command may not search current directory first
author Pascal Bellard <pascal.bellard@slitaz.org>
date Sun Jul 23 13:50:45 2017 +0200 (2017-07-23)
parents
children
line source
1 #!/bin/sh
2 #
3 # Tiny CGI SHell example for SliTaz ARM
4 #
5 # $ startd httpd
6 # URL: http://rpi.ip/adm/
7 #
8 echo "Content type: text/plain"
9 echo ""
11 # Only for root
12 [ $(id -u) == 0 ] || exit 1
14 cpu_temp() {
15 awk '{printf "%3.1f C", $1/1000}' \
16 /sys/class/thermal/thermal_zone0/temp
17 }
19 # tazberry rpi_stats
20 cat << EOT
21 SliTaz Raspberry Pi Stats
22 -------------------------
24 Kernel : $(uname -snrm)
25 Uptime :$(uptime | cut -d "," -f 1,2)
26 CPU Temp : $(cpu_temp)
28 Memory and filesystem usages
29 ----------------------------
30 $(free -m)
32 $(df -h)
34 Network interfaces
35 ------------------
36 $(ifconfig)
37 EOT