#!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin . /usr/lib/libmodcgi.sh get_env() { cat /proc/sys/urlader/environment | grep "^$1" | sed -e 's/'"$1"' //' } stat_bar() { percent=$1; let bar="percent*4"; let grey="(100-percent)*4" echo '
'$percent' %
' } stat_button() { echo '' } cgi_begin '$(lang de:"Status" en:"Status")' 'status' sec_begin '$(lang de:"Box" en:"Box")' cat << EOFEOF sec_end sec_begin '$(lang de:"Hauptspeicher (RAM)" en:"Main memory (RAM)")' total="$(cat /proc/meminfo | grep '^MemTotal:' | sed s/[^0-9]//g)" free="$(cat /proc/meminfo | grep '^MemFree:' | sed s/[^0-9]//g)" cached="$(cat /proc/meminfo | grep '^Cached:' | sed s/[^0-9]//g)" let usedwc="total-cached-free" let percent="100*usedwc/total" echo "
$usedwc $(lang de:"von" en:"of") $total KB $(lang de:"belegt (ohne Cache)" en:"used (without cache)")
" stat_bar $percent sec_end sec_begin '$(lang de:"Flash-Speicher (TFFS) für Konfigurationsdaten" en:"Flash memory (TFFS) for configuration data")' echo 'info' > /proc/tffs percent="$(cat /proc/tffs | grep '^fill=')" percent="${percent#fill=}" let tffs_size="$(printf "%d" "0x$(cat /proc/mtd | grep tffs | head -n1 | awk '{print $2}')")/1024" let tffs_used="tffs_size*percent/100" echo "$tffs_used $(lang de:"von" en:"of") $tffs_size KB $(lang de:"belegt" en:"used")
" stat_bar $percent sec_end stat_button 'restart_dsld' '$(lang de:"DSL-Reconnect" en:"Reconnect DSL")' stat_button 'cleanup' '$(lang de:"TFFS aufräumen" en:"Clean up TFFS")' stat_button 'fw_attrib' '$(lang de:"Attribute bereinigen" en:"Clean up attributes")' stat_button 'downgrade' '$(lang de:"Downgrade-Mod" en:"Downgrade mod")' stat_button 'firmware_update' '$(lang de:"Firmware-Update" en:"Update firmware")' stat_button 'reboot' '$(lang de:"Reboot" en:"Reboot")' cgi_end