#!/bin/sh # # Initscript for the Openroupware.org application server # PNAME="opengroupware.org-zidestore" DAEMON=ZideStore CDPATH=/usr/lib/opengroupware.org/System/WOApps/ZideStore.woa WRAPPER=/usr/lib/opengroupware.org/bin/start-zidestore DEFAULT=/etc/default/$PNAME PIDFILE=/var/lib/opengroupware.org/opengroupware.org-zidestore.pid if [ -e $DEFAULT ]; then . $DEFAULT fi if [ -z "$ARGS" ]; then ARGS="-WOPort 21000 -WOHttpAllowHost localhost" fi if [ -z "$LOGFILE" ]; then LOGFILE=/var/log/opengroupware.org-zidestore.log fi should_start() { if [ "$START_AT_BOOT" = "false" ]; then echo "ZideStore WebDAV server not started as requested" exit 0 fi if [ ! -x $CDPATH/$DAEMON ]; then echo "ZideStore WebDAV server is not executable, not starting" exit 0 fi } case "$1" in start) should_start echo "Starting ZideStore WebDAV 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-zidestore -c ogo -a $WRAPPER -- -a "$ARGS" -l "$LOGFILE" -p $PIDFILE ;; stop) echo "Stopping ZideStore WebDAV server: $DAEMON." start-stop-daemon -K -p $PIDFILE -o ;; restart|force-reload) $0 stop $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