#!/bin/sh -e
#
# roundup-dirs	Create runit dirs for the roundup http server.
#
# Version:	$Id$
#
### BEGIN INIT INFO
# Provides:          roundup-dirs
# Required-Start:    $local_fs $remote_fs
# Required-Stop:     $remote_fs
# Should-Start:
# Should-Stop:
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: Create 'runit' dirs for the roundup HTTP server
# Description:       Start the stand-alone roundup HTTP server
### END INIT INFO


DESC='Runit dirs for the Roundup HTTP-Server'

BINFILE=roundup-server
EXECUTABLE=/usr/bin/$BINFILE
RUNIT=/usr/bin/runsv


test -x $EXECUTABLE && test -x $RUNIT || exit 0

start_stop() {
	case "$1" in
	start)
		printf "$DESC:"
		install -o root -g root -m 755 -d /var/run/roundup
		install -o root -g root -m 755 -d /var/run/roundup.log
		;;
	stop)
		;;
	restart|force-reload)
		start_stop stop
		sleep 1
		start_stop start
		;;
	*)
		printf "Usage: $0 {start|stop|restart}\n" >&2
		exit 1
		;;
	esac
}

exit 0

