#!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin . /usr/lib/libmodcgi.sh get_env() { cat /proc/sys/dev/adam2/environment | grep "^$1" | sed -e 's/'"$1"' //' } stat_bar() { percent=$1; let bar="percent*4"; let grey="(100-percent)*4" echo '

' } stat_button() { echo '
' } cgi_begin 'Status' 'status' sec_begin 'Box' cat << EOF

$(lang de:"Firmware" en:"firmware"): $(get_env 'firmware_info')$(cat /etc/.subversion)
$(lang de:"Branding" en:"branding"):

EOF sec_end sec_begin '$(lang de:"Hauptspeicher" en:"Memory")' free="$(cat /proc/meminfo | grep '^Mem:')" echo "${free#Mem:}" | while read -r total used free shared buffers cached; do let usedwc="used-cached" let percent="100*usedwc/total" let total_kb="total/1024" let usedwc_kb="usedwc/1024" echo "

$(lang de:"Gesamt" en:"total"): $total_kb KB
" echo "$(lang de:"Belegt" en:"used"): $usedwc_kb KB ($(lang de:"ohne Cache" en:"without cache"))

" stat_bar $percent done sec_end sec_begin 'Flash' echo 'info' > /proc/tffs percent="$(cat /proc/tffs | grep '^fill=')" percent="${percent#fill=}" echo "

$(lang de:"tffs ist zu ${percent}% belegt." en:"tffs fill: ${percent}%")

" stat_bar $percent sec_end stat_button 'reboot' 'Reboot' stat_button 'cleanup' 'Cleanup tffs' stat_button 'downgrade' 'Downgrade Mod' cgi_end