aboutsummaryrefslogtreecommitdiff
path: root/init.d/local.in
blob: 8bcdc6c37cc400eefd59a7ac92e8fd79279f2b19 (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
42
43
#!@PREFIX@/sbin/runscript
# Copyright 2007-2008 Roy Marples <roy@marples.name>
# All rights reserved. Released under the 2-clause BSD license.

description="Executes user commands in /etc/conf.d/local"

depend()
{
	after *
	keyword notimeout
}

start()
{
	ebegin "Starting local"

	if type local_start >/dev/null 2>&1; then
		local_start
	fi

	# Support old configs
	if [ -e @SYSCONFDIR@/conf.d/local.start ]; then
		. @SYSCONFDIR@/conf.d/local.start
	fi

	eend $? "Failed to start local"
}

stop()
{
	ebegin "Stopping local"

	if type local_start >/dev/null 2>&1; then
		local_stop
	fi

	# Support old configs
	if [ -e @SYSCONFDIR@/conf.d/local.stop ]; then
		. @SYSCONFDIR@/conf.d/local.stop
	fi

	eend $? "Failed to stop local"
}