#!/bin/sh # # Initscript for the Openroupware.org application server # PNAME="opengroupware.org-webui" DAEMON=OpenGroupware CDPATH=/usr/lib/opengroupware.org/System/WOApps/OpenGroupware.woa WRAPPER=/usr/lib/opengroupware.org/bin/start-webui DEFAULT=/etc/default/$PNAME PIDFILE=/var/lib/opengroupware.org/opengroupware.org-webui.pid if [ -e $DEFAULT ]; then . $DEFAULT fi if [ -z "$ARGS" ]; then ARGS="-WOPort 20000 -WOHttpAllowHost localhost" fi if [ -z "$LOGFILE" ]; then LOGFILE=/var/log/opengroupware.org-webui.log fi should_start() { if [ "$START_AT_BOOT" = "false" ]; then echo "OpenGroupware.org web application server not started as requested" exit 0 fi if [ ! -x $CDPATH/$DAEMON ]; then echo "OpenGroupware.org web application server is not executable, not starting" exit 0 fi } case "$1" in start) should_start echo "Starting OpenGroupware.org web application server: $DAEMON." if [ ! -f $LOGFILE ]; then touch $LOGFILE fi chown ogo:ogo $LOGFILE chmod 640 $LOGFILE start-stop-daemon -S -b -p $PIDFILE -n start-webui -c ogo -a $WRAPPER -- -a "$ARGS" -l "$LOGFILE" -p $PIDFILE ;; stop) echo "Stopping OpenGroupware.org web application server: $DAEMON." start-stop-daemon -K -p $PIDFILE -o ;; restart|force-reload) $0 stop sleep 1 $0 start ;; reload) echo "Can't reload configuration without restarting. Use /etc/init.d/$PNAME restart." exit 0 ;; *) echo "Usage: /etc/init.d/$PNAME {start|stop|reload|force-reload|restart}" exit 1 ;; esac