summaryrefslogtreecommitdiff
path: root/net/spread4/files/spread.sh
blob: ebeb5adf697f11e2e4ae8b5b7956eadb8c09316b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/bin/sh
#
# $FreeBSD$

if ! prefix=$(expr $0 : "\(/.*\)/etc/rc\.d/$(basename $0)\$"); then
    echo "$0: Cannot determine the prefix" >&2
    exit 1
fi
spread=${prefix}/sbin/spread
pidfile=/var/run/spread.pid
out=/var/log/spread.out
daemon=/usr/sbin/daemon

case "$1" in
start)
	if [ -x ${spread} ]; then
		echo -n ' spread'
		${daemon} -c ${spread} >${out} 2>&1 <&-
	fi
	;;
stop)
	if [ -f ${pidfile} ]; then
		kill `cat ${pidfile}`
		echo -n ' spread'
		rm ${pidfile}
	else
		echo ' spread: not running'
	fi
	;;
*)
	echo "Usage: `basename $0` {start|stop}" >&2
	exit 64
	;;
esac

exit 0