#!/bin/sh

RUN_AS_USER=confluence
CONFLUENCE_INSTALL=/x1/cwiki/current

start() {
        echo "Starting Confluence: "
        umask 002
        if [ "x$USER" != "x$RUN_AS_USER" ]; then
          su - $RUN_AS_USER -c "cd $CONFLUENCE_INSTALL/bin && ./startup.sh"
        else
          $CONFLUENCE_INSTALL/bin/startup.sh
        fi
        echo "done."
}
stop() {
        echo "Shutting down Confluence: "
        if [ "x$USER" != "x$RUN_AS_USER" ]; then
          su - $RUN_AS_USER -c "cd $CONFLUENCE_INSTALL/bin && ./shutdown.sh"
        else
          $CONFLUENCE_INSTALL/bin/shutdown.sh
        fi
        echo "done."
}

case "$1" in
  start)
        start
        ;;
  stop)
        stop
        ;;
  restart)
        stop
        sleep 8
        start
        ;;
  *)
        echo "Usage: $0 {start|stop|restart}"
esac

exit 0


Add init script raw, ready to template
Add init script raw, ready to template
