--- 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}`