Merge from vendor branch TNF:
[pkgsrcv2.git] / net / spread / files / spread.sh
1 #!@RCD_SCRIPTS_SHELL@
2 #
3 # $NetBSD: spread.sh,v 1.1 2003/02/22 23:37:14 mjl Exp $
4 #
5 # PROVIDE: spread
6 # REQUIRE: DAEMON
7 #
8 # To start spread at startup, copy this script to /etc/rc.d and set
9 # spread=YES in /etc/rc.conf.
10 #
11 # Addtionally you may set spread_log to a file where to log stuff.
12
13 if [ -f /etc/rc.subr ]; then
14         . /etc/rc.subr
15 fi
16
17 rcd_dir=`@DIRNAME@ $0`
18
19 name="spread"
20 rcvar=$name
21 command="@PREFIX@/sbin/${name}"
22 if [ X"${spread_log}" != "X" ] ; then
23    log=">${spread_log} 2>&1"
24 else
25    log=">/dev/null 2>&1"
26 fi
27 required_files="@PKG_SYSCONFDIR@/spread.conf"
28
29 command_args="${log} </dev/null &"
30 start_precmd="spread_precmd"
31
32 spread_precmd()
33 {
34         if [ ! -d @RUNTIME_DIR@ ]
35         then
36                 @MKDIR@ @RUNTIME_DIR@
37                 @CHMOD@ 0750 @RUNTIME_DIR@
38                 @CHOWN@ @PKG_USERS@ @RUNTIME_DIR@
39         fi
40 }
41
42 load_rc_config $name
43 run_rc_command "$1"