#!/bin/sh PACKAGEURL=/cgi-bin/pkgconf.cgi?pkg= SETTINGSURL=/cgi-bin/settings.cgi PATH=/bin:/usr/bin:/sbin:/usr/sbin . /usr/lib/libmodcgi.sh stat_begin() { echo '
' } stat_packagelink() { if [ "$1" = "crond" -o "$1" = "swap" -o "$1" = "telnetd" -o "$1" = "webcfg" ]; then echo ''"$1"'' else echo ''"$1"'' fi } stat_line() { status="$(/mod/etc/init.d/rc.$1 status 2> /dev/null)" if [ -n "$2" ]; then name="$2"; else name="$1"; fi case "$status" in running) color="#008000" start=0; stop=1 ;; stopped) color="#800000" start=1; stop=0 ;; inetd) case "$inetd_status" in running) color="#008000" ;; stopped) color="#800000" ;; none) color="#808080" inetd_status='none' ;; *) color="#000000" ;; esac status="$inetd_status ($status)" start=0; stop=0; ;; none) status='none' color="#808080" start=1; stop=0 ;; *) color="#000000" start=1; stop=1 ;; esac echo ' | |
'$(stat_packagelink $name)' | '"$status"' | ' stat_button $1 start $start stat_button $1 stop $stop stat_button $1 restart $stop echo '
$(lang de:"keine statischen Pakete" en:"no static packages")
' fi stat_end sec_end } stat_dynamic() { sec_begin '$(lang de:"Dynamische Pakete" en:"Dynamic packages")' echo '$(lang de:"(noch) nicht implementiert" en:"not implemented yet")
' sec_end } cgi_begin '$(lang de:"Dienste" en:"Services")' 'daemons' view="$(echo "$QUERY_STRING" | sed -e 's/^.*view=//' -e 's/&.*$//' -e 's/\.//g')" if [ -e /etc/default.inetd/inetd.cfg ]; then inetd=true else inetd=false fi if [ "true" == "$inetd" ]; then inetd_status="$(/etc/init.d/rc.inetd status 2> /dev/null)" fi # comment out dynamic packages until we implemented it case "$view" in "") stat_builtin stat_static # stat_dynamic ;; builtin) stat_builtin ;; static) stat_static ;; # dynamic) # stat_dynamic # ;; *) echo "$(lang de:"Fehler" en:"Error"): $(lang de:"Unbekannte Ansicht" en:"unknown view") '$view'
" ;; esac cgi_end