#!/bin/sh PATH=/bin:/usr/bin:/sbin:/usr/sbin . /usr/lib/libmodcgi.sh eval "$(modcgi branding:pkg:cmd mod_cgi)" case "$MOD_CGI_CMD" in start|stop|restart) if [ ! -x "/mod/etc/init.d/rc.$MOD_CGI_PKG" ]; then cgi_begin '$(lang de:"Fehler" en:"Error")' echo "
$(lang de:"Fehler" en:"Error"): $(lang de:"Kein Skript für" en:"no script for") '$MOD_CGI_PKG'
" cgi_end exit 1 fi ;; esac case "$MOD_CGI_CMD" in branding) cgi_begin '$(lang de:"Branding ändern" en:"Change branding")...' echo '$(lang de:"Um die Änderungen wirksam zu machen, ist ein Neustart erforderlich." en:"You must reboot the device for the changes to take effect.")
' echo -n 'set branding to '"'$MOD_CGI_BRANDING'"'...' success=0 for i in $(ls /usr/www/); do case "$i" in all|cgi-bin|html|kids) ;; *) if [ "$i" = "$MOD_CGI_BRANDING" ]; then echo "firmware_version $i" > /proc/sys/urlader/environment success=1 fi ;; esac done if [ "$success" -eq 1 ]; then echo 'done.' else echo 'failed.' fi echo '' cgi_end ;; cleanup) cgi_begin '$(lang de:"Defragmentiere" en:"Clean up TFFS")...' echo -n '
tffs cleanup...' echo 'cleanup' > /proc/tffs echo 'done.' echo '' cgi_end ;; downgrade) cgi_begin 'Downgrade mod...' echo '
$(lang de:"Downgrade mod von supamicha" en:"Downgrade mod by supamicha"):
$(lang de:"Ändert die Firmware Version bis zum nächsten Neustart auf xx.01.01" en:"Changes the firmware version to xx.01.01 until next reboot")
Downgrading...' if [ -e /var/tmp/version ]; then echo 'already done.' else sed 's/{CONFIG_VERSION_MAJOR}.*/{CONFIG_VERSION_MAJOR}.01.01/1' /etc/version > /var/tmp/version chmod +x /var/tmp/version mount -o bind /var/tmp/version /etc/version echo 'done.' fi echo '' cgi_end ;; firmware_update) cgi_begin '$(lang de:"Firmware-Update" en:"Firmware update")' /usr/mww/cgi-bin/firmware_update.cgi cgi_end ;; fw_attrib) cgi_begin '$(lang de:"Attribute bereinigen" en:"Clean up attributes")' echo '
$(lang de:"Entfernt Merker für \"nicht unterstützte Änderungen\"" en:"Cleans up marker for \"unauthorized changes\"")
' echo -n '$(lang de:"bereinige Attribute" en:"cleaning up attributes")...' major=$(grep tffs /proc/devices) tffs_major=${major%%tffs} rm -f /var/flash/fw_attrib mknod /var/flash/fw_attrib c $tffs_major 87 echo -n "" > /var/flash/fw_attrib rm -f /var/flash/fw_attrib echo ' $(lang de:"fertig" en:"done").' echo '' cgi_end ;; restart_dsld) cgi_begin '$(lang de:"Starte dsld neu" en:"Restart dsld")...' echo -n '
Stopping dsld...' echo '' cgi_end ;; reboot) cgi_begin '$(lang de:"Neustart" en:"Reboot")...' echo '
' dsld -s sleep 3 echo -n 'Restarting dsld...
' dsld -n echo -n 'done.
$(lang de:"Starte neu" en:"Rebooting")...
' echo '$(lang de:"Nach dem Neustart hier wieder einloggen." en:"Login here after reboot.")
' cgi_end reboot ;; start) cgi_begin "$(lang de:"Starte" en:"Starting") $MOD_CGI_PKG..." echo "$(lang de:"Starte" en:"Starting") $MOD_CGI_PKG:
" echo -n '' /mod/etc/init.d/rc.$MOD_CGI_PKG start | html echo '' echo '' cgi_end ;; stop) cgi_begin "$(lang de:"Stoppe" en:"Stopping") $MOD_CGI_PKG..." echo "
$(lang de:"Stoppe" en:"Stopping") $MOD_CGI_PKG:
" echo -n '' /mod/etc/init.d/rc.$MOD_CGI_PKG stop | html echo '' echo '' cgi_end ;; restart) cgi_begin "$(lang de:"Starte $MOD_CGI_PKG neu" en:"Restarting $MOD_CGI_PKG")..." echo "
$(lang de:"Starte $MOD_CGI_PKG neu" en:"Restarting $MOD_CGI_PKG"):
" echo -n '' /mod/etc/init.d/rc.$MOD_CGI_PKG restart | html echo '' echo '' cgi_end ;; *) cgi_begin '$(lang de:"Fehler" en:"Error")' echo "
$(lang de:"Fehler" en:"Error"): $(lang de:"Unbekannter Befehl" en:"unknown command") '$MOD_CGI_CMD'
" cgi_end ;; esac