summaryrefslogtreecommitdiff
path: root/www/wwwoffle/files/wwwoffled
blob: 7bb72402af9c3c61266448e83cd8e2baa6e9c316 (plain)
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
#
# $NetBSD: wwwoffled,v 1.4 2002/08/10 17:03:27 fredb Exp $
#
# PROVIDE: wwwoffled
# REQUIRE: DAEMON network

if [ -f /etc/rc.subr ]; then
	. /etc/rc.subr
fi

name="wwwoffled"
command="@PREFIX@/sbin/${name}"
control_prog="@PREFIX@/bin/wwwoffle"
command_args="-c @PKG_SYSCONFDIR@/wwwoffle.conf"
required_files="@PKG_SYSCONFDIR@/wwwoffle.conf"
start_cmd=wwwoffled_start
stop_cmd="${control_prog} ${command_args} -kill"
autodial_cmd="${control_prog} -autodial ${command_args}"
offline_cmd="${control_prog} -offline ${command_args}"
online_cmd="${control_prog} -online ${command_args}"
extra_commands="autodial offline online"

wwwoffled_start() {
	eval "${command} ${command_args}"
	eval "${control_prog} -online ${command_args}"
	eval "${control_prog} -fetch ${command_args}"
}

if [ -f /etc/rc.subr -a -d /etc/rc.d -a -f /etc/rc.d/DAEMON ]; then
	load_rc_config $name
	run_rc_command "$1"
else
	echo -n ' ${name}'
	${start_cmd}
fi