tazpanel diff boot.cgi @ rev 81

Use httpd_helper parser (GET)
author Pascal Bellard <pascal.bellard@slitaz.org>
date Wed Apr 13 16:41:02 2011 +0200 (2011-04-13)
parents 7ac8e561d0a5
children a797e9424727
line diff
     1.1 --- a/boot.cgi	Tue Apr 12 04:24:35 2011 +0200
     1.2 +++ b/boot.cgi	Wed Apr 13 16:41:02 2011 +0200
     1.3 @@ -4,12 +4,11 @@
     1.4  #
     1.5  # Copyright (C) 2011 SliTaz GNU/Linux - GNU gpl v3
     1.6  #
     1.7 -echo "Content-Type: text/html"
     1.8 -echo ""
     1.9  
    1.10  # Common functions from libtazpanel and source main boot config file.
    1.11  . lib/libtazpanel
    1.12  . /etc/rcS.conf
    1.13 +header
    1.14  get_config
    1.15  
    1.16  # Include gettext helper script.
    1.17 @@ -25,21 +24,20 @@
    1.18  # Commands
    1.19  #
    1.20  
    1.21 -case "$QUERY_STRING" in
    1.22 -	daemons*)
    1.23 +case " $(GET) " in
    1.24 +	*\ daemons\ *)
    1.25  		#
    1.26  		# Everything until user login
    1.27  		#
    1.28  		# Start and stop a daemon. I think we dont need restart since 2 
    1.29  		# clicks and you are done
    1.30 -		case "$QUERY_STRING" in
    1.31 -			*=start=*)
    1.32 -				daemon=${QUERY_STRING#*=start=}
    1.33 +		daemon=$(GET daemons)
    1.34 +		case "$daemon" in
    1.35 +			start=*)
    1.36  				sleep 1
    1.37 -				/etc/init.d/$daemon start | log ;;
    1.38 -			*=stop=*)
    1.39 -				daemon=${QUERY_STRING#*=stop=}
    1.40 -				/etc/init.d/$daemon stop | log ;;
    1.41 +				/etc/init.d/${daemon#start=} start | log ;;
    1.42 +			stop=*)
    1.43 +				/etc/init.d/${daemon#stop=} stop | log ;;
    1.44  		esac
    1.45  		. /etc/rcS.conf
    1.46  		TITLE="- Boot"