All pastes #900873 Raw Edit

Anonymous

public shellscript v1 · immutable
·published 2008-02-12 07:15 UTC
rendered paste body
#!/bin/sh######################################## Configuration# Root Django project directoryPROJROOT="/home/zarin/django"# Projects to start a FastCGI daemon forPROJECTS="undefinedfire gallery"# Location of manage.py in the projectMANAGE="apps/www/manage.py"# Extra arguments to pass to manage.pyARGS=""#######################################case "$1" instart)	echo -n "Starting Django FastCGI daemons..."	for PROJECT in $PROJECTS; do		PIDFILE="$PROJROOT/$PROJECT/fcgi.pid"		SOCKET="$PROJROOT/$PROJECT/fcgi.sock"		cd $PROJROOT/$PROJECT		# Automatically kill the daemon if it's ready running		if [ -f $PIDFILE ]; then			PID=`cat -- $PIDFILE`			if ( `ps -p $PID -o cmd= | grep $PIDFILE` ); then				kill $PID			else				echo "Process $PID doesn't belong to us! Didn't kill."			fi			rm -f -- $PIDFILE		fi		python $MANAGE runfcgi socket=$SOCKET pidfile=$PIDFILE $ARGS	done	echo " Done"	;;stop)	echo -n "Stopping Django FastCGI daemons..."	for PROJECT in $PROJECTS; do		PIDFILE="$PROJROOT/$PROJECT/fcgi.pid"		SOCKET="$PROJROOT/$PROJECT/fcgi.sock"		cd $PROJROOT/$PROJECT		if [ -f $PIDFILE ]; then			PID=`cat -- $PIDFILE`			if ( `ps -p $PID -o cmd= | grep $PIDFILE` ); then				kill $PID			else				echo "Process $PID doesn't belong to us! Didn't kill."			fi			rm -f -- $PIDFILE		fi	done	echo " Done"	;;restart)	echo -n "Restarting Django FastCGI daemons..."	$0 stop > /dev/null	sleep 1	$0 start > /dev/null	echo " Done"	;;*)	echo "Usage: $0 {start|stop|restart}"	;;esacwhy the fuck dont this work :S