summaryrefslogtreecommitdiff
path: root/init.d/local.in
blob: 16b4d9b161ba60742b03fa5e91e376cdfda0da61 (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
44
45
46
47
48
49
#!@PREFIX@/sbin/runscript
# Copyright (c) 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 -timeout
}

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
		ewarn @SYSCONFDIR@/conf.d/local.start is depricated. Please migrate
		ewarn the contents of this file to the local_start
		ewarn function in @SYSCONFDIR@/conf.d/local and remove the file.
		. @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
		ewarn @SYSCONFDIR@/conf.d/local.stop is depricated. Please migrate
		ewarn the contents of this file to the local_stop
		ewarn function in @SYSCONFDIR@/conf.d/local and remove the file.
		. @SYSCONFDIR@/conf.d/local.stop
	fi

	eend $? "Failed to stop local"
}