scripts/runbot
changeset 27 4a2f7a1492ab
parent 26 767f79e69de1
child 31 bbcb8a3366b4
--- a/scripts/runbot
+++ b/scripts/runbot
@@ -10,22 +10,25 @@
 # Description:       IRC BOT mcbot
 ### END INIT INFO
 
+RUNAS="nobody"
 BINARY="mcbot"
 DIRECTORY="/usr/sbin/"
 LANGUAGE="de_DE.UTF-8"
+PARAMETER=""
+LOGFILE="/var/lib/nobody/mcbot-`date \"+%d-%m-%y\"`.log"
 
 [[ ! -x "${DIRECTORY}/${BINARY}" ]] && exit 0
 
 start() {
-	echo -n "Starting ${BINARY}"
-	su - nobody -c "LANG=$LANGUAGE ${DIRECTORY}/${BINARY} &>/var/lib/nobody/mcbot-`date "+%d-%m-%y"`.log &"
+	echo -n " * Starting ${BINARY}"
+	su - ${RUNAS} -c "LANG=$LANGUAGE ${DIRECTORY}/${BINARY} ${PARAMETER} &> ${LOGFILE} &"
 	if [ "$?" == 0 ]; then
 		echo " [started]"
 	fi
 }
 
 stop() {
-	echo -n "Stopping ${BINARY}"
+	echo -n " * Stopping ${BINARY}"
 	pid=`pidof ${BINARY}`
 	if [ "$pid" != "" ]; then
 		kill -TERM `pidof ${BINARY}`