#!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin . /usr/lib/libmodcgi.sh get_env() { sed -n "s/^$1 //p" /proc/sys/urlader/environment } meminfo() { sed -n "/^$1:/ s/[^0-9]//gp" /proc/meminfo } stat_bar() { let multip="($_cgi_width-230-50)/100"; percent=$1; let bar="percent*multip"; let grey="(100-percent)*multip" echo '
'$percent' %
' } btn_count=0 stat_button() { let _btn_width="($_cgi_width-230+16)/3" btn_count=$((btn_count + 1)) echo '' [ $btn_count -eq 3 ] && ( btn_count=0; echo '$(lang de:"Standard-Passwort gesetzt. Bitte hier ändern." en:"Default password set. Please change here.")
' fi sec_begin '$(lang de:"Box" en:"Box")' cat << EOF$(lang de:"Firmware" en:"Firmware"): $(get_env firmware_info)$(cat /etc/.freetz-version)
EOF brands_cnt=0 for i in $(ls /usr/www/); do case "$i" in all|cgi-bin|html|kids) ;; *) BRANDS="$BRANDS $i" let brands_cnt++ ;; esac done if [ $brands_cnt -gt 1 ]; then echo '' else branding=$(get_env firmware_version) BRANDS=${BRANDS# } echo "$(lang de:"Branding" en:"Branding"):" echo "$branding" if [ "$branding" != "$BRANDS" ]; then echo "($(lang de:"nicht installiert" en:"not installed"))" fi fi cat << EOF | $(lang de:"Uptime" en:"Uptime"): $(uptime | sed -r 's/.* up (.*), load .*/\1/') |
$usedwc $(lang de:"von" en:"of") $total KB $(lang de:"belegt (ohne Cache $cached KB)" en:"used (without cache $cached KB)")
" 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=$(grep '^fill=' /proc/tffs) percent=${percent#fill=} let tffs_size="0x$(awk '/tffs/ { print $2; exit }' /proc/mtd)/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 if has_swap; then sec_begin '$(lang de:"Swap-Speicher" en:"Swap") (RAM)' total=$(meminfo SwapTotal) free=$(meminfo SwapFree) cached=$(meminfo SwapCached) let usedwc="total-cached-free" let percent="100*usedwc/total" echo "$usedwc $(lang de:"von" en:"of") $total KB $(lang de:"belegt" en:"used") ($(lang de:"ohne Cache" en:"without cache") $cached KB)
" stat_bar $percent sec_end fi [ "$MOD_MOUNTED_MAIN" = yes ] && . /usr/lib/cgi-bin/mod/mounted.cgi 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