tazpanel rev 361

tazpanel: rm on stop
author Richard Dunbar <mojo@slitaz.org>
date Sun May 19 17:50:19 2013 +0000 (2013-05-19)
parents bb7e9e0838e5
children 8ec43100e75e
files tazpanel
line diff
     1.1 --- a/tazpanel	Sun Apr 14 19:21:42 2013 +0000
     1.2 +++ b/tazpanel	Sun May 19 17:50:19 2013 +0000
     1.3 @@ -31,16 +31,26 @@
     1.4  PIDFILE=/var/run/$NAME.pid
     1.5  
     1.6  case "$1" in
     1.7 -	start)
     1.8 +	start)  
     1.9 +	        if [ -f $PIDFILE ]; then
    1.10 +	        gettext 'TazPanel is already running.'; echo
    1.11 +	        exit 1
    1.12 +	        fi
    1.13  		eval_gettext 'Starting TazPanel web server on port $HTTPD_PORT...'
    1.14  		httpd -p $HTTPD_PORT -u root -c $HTTPD_CONF \
    1.15  			-r "$(gettext 'TazPanel Authentication - Default: root:root')" &
    1.16  		ps | grep "httpd -p $HTTPD_PORT " | grep -v grep | \
    1.17  			awk '{ print $1 }' > $PIDFILE
    1.18  		status ;;
    1.19 -	stop)
    1.20 +	stop)   
    1.21 +	        if [ ! -f $PIDFILE ]; then
    1.22 +	        gettext 'TazPanel is not running.'; echo
    1.23 +	        exit 1
    1.24 +	        fi
    1.25  		gettext 'Stopping TazPanel web server...'
    1.26 -		kill $(pgrep -f TazPanel) && status ;;
    1.27 +		kill $(pgrep -f TazPanel) 
    1.28 +		rm -f $PIDFILE
    1.29 +		status ;;
    1.30  	passwd|-p)
    1.31  		echo ""
    1.32  		gettext 'Changing password for TazPanel'; echo