diff options
author | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-11-25 21:24:58 +0100 |
---|---|---|
committer | Adrian C. (anrxc) <anrxc@sysphere.org> | 2012-11-25 21:24:58 +0100 |
commit | 16262790cb6ddacf6c632625cc865e03b1b8671f (patch) | |
tree | 09898d65deef518380915ecdc7575756c9ca8595 /src/trac/tracd | |
parent | 7bb1499a7cd539f714bb7f603d7fc0a38fd8a963 (diff) | |
download | rcdscripts-2012.11.25.tar.xz |
rcdscripts: import first snapshot of rc.d scripts as of 11.25.20122012.11.25
In 30 days these scripts will start dissapearing from official Arch
Linux packages. This is an attempt to conserve them, and keep sysvinit
usable.
Diffstat (limited to 'src/trac/tracd')
-rwxr-xr-x | src/trac/tracd | 48 |
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 |