summaryrefslogtreecommitdiff
path: root/sysutils/webmin/files/webmin.sh
blob: b43a75420eb30e6a9833b27285b6cb46ecfcaf87 (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
37
38
39
40
41
#!@RCD_SCRIPTS_SHELL@
#
# $NetBSD: webmin.sh,v 1.2 2005/01/23 04:36:27 jlam Exp $
#

# PROVIDE: webmin
# REQUIRE: LOGIN

. /etc/rc.subr

name="webmin"
rcvar=${name}
command="@WEBMIN_DIR@/miniserv.pl"
command_interpreter="@PERL5@"
webmin_etcdir="@WEBMIN_ETCDIR@"
required_files="@WEBMIN_ETCDIR@/miniserv.conf"

start_cmd="webmin_doit start"
stop_cmd="webmin_doit stop"

webmin_doit()
{
	case $1 in
	start)	script="${webmin_etcdir}/start" ;;
	stop)	script="${webmin_etcdir}/stop" ;;
	*)
	esac
	required_files="$required_files $script"
	for f in $required_files; do
		if [ ! -r "$f" ]; then
			@ECHO@ 1>&2 "$0: WARNING: $f is not readable"
			if [ -z $rc_force ]; then
				return 1
			fi
		fi
	done
	$script
}

load_rc_config $name
run_rc_command "$1"