aboutsummaryrefslogtreecommitdiff
path: root/src/trac/tracd
diff options
context:
space:
mode:
Diffstat (limited to 'src/trac/tracd')
-rwxr-xr-xsrc/trac/tracd48
1 files changed, 48 insertions, 0 deletions
diff --git a/src/trac/tracd b/src/trac/tracd
new file mode 100755
index 0000000..2b07fcf
--- /dev/null
+++ b/src/trac/tracd
@@ -0,0 +1,48 @@
+#!/bin/sh
+
+. /etc/conf.d/tracd.conf
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+DAEMON_NAME=tracd
+
+if [ -z "$PORT" ]; then
+ PORT="-p 8080"
+else
+ PORT="-p $PORT"
+fi
+
+if [ -z "$AUTH" ]; then
+ AUTH=
+else
+ AUTH="--auth ${AUTH//;/ --auth }"
+fi
+
+case "$1" in
+ start)
+ if [ -z "$PROJECT" ]; then
+ echo "You need to set the project path in /etc/conf.d/${DAEMON_NAME}.conf"
+ exit 1
+ fi
+ stat_busy "Starting $DAEMON_NAME: "
+ tracd -d $HOSTNAME $PORT $AUTH $PROJECT
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon $DAEMON_NAME
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Shutting down $DAEMON_NAME: "
+ kill `ps ax|grep pyth|grep tracd|awk -- "{print \\$1;}"`
+ rm_daemon $DAEMON_NAME
+ stat_done
+ ;;
+ reload|restart)
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "Usage: $0 {start|stop|restart|reload}"
+esac