Major changes, preparation, so that Nexus can run unix-ified as well.
[archlinuxdevstack.git] / nexus / nexus
blob98c3a9c2b77393717e2e35fbc744063fb53d0f6f
1 #!/bin/bash
3 # general config
4 . /etc/rc.conf
5 . /etc/rc.d/functions
7 # environment variables for the use with sonar
8 PID_DIR=/var/run/nexus
9 HOME_DIR=/opt/nexus
10 BIN_DIR=$HOME_DIR/bin
11 ETC_DIR=/etc/nexus
15 case "$1" in
16 start)
17 stat_busy "Starting Nexus Repository Manager"
19 if [ ! -x $PID_DIR ] ; then
20 install -m755 -g nexus -o nexus -d $PID_DIR
23 su -c "$BIN_DIR/nexus.sh start" nexus
24 if [ $? -gt 0 ]; then
25 stat_fail
26 else
27 stat_done
30 stop)
31 stat_busy "Stopping Nexus Repository Manager"
33 [ -f $PID_DIR/nexus.pid ] && su -c "$BIN_DIR/nexus.sh stop" nexus 2>&1
34 if [ $? -gt 0 ]; then
35 stat_fail
36 else
37 rm -r $PID_DIR
38 stat_done
41 restart)
42 $0 stop
43 sleep 1
44 $0 start
47 echo "usage: $0 {start|stop|restart}"
49 esac
50 exit 0