Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
View | Details | Raw Unified | Return to bug 505166
Collapse All | Expand All

(-)hostapd-init.d (-18 / +7 lines)
Lines 3-8 Link Here
3
# Distributed under the terms of the GNU General Public License v2
3
# Distributed under the terms of the GNU General Public License v2
4
# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d,v 1.3 2011/09/25 14:03:46 gurligebis Exp $
4
# $Header: /var/cvsroot/gentoo-x86/net-wireless/hostapd/files/hostapd-init.d,v 1.3 2011/09/25 14:03:46 gurligebis Exp $
5
5
6
pidfile="/var/run/${SVCNAME}.pid"
7
command="/usr/sbin/hostapd"
8
command_args="-P ${pidfile} -B ${OPTIONS} ${CONFIGS}"
9
6
extra_started_commands="reload"
10
extra_started_commands="reload"
7
11
8
depend() {
12
depend() {
Lines 15-21 Link Here
15
	use logger
19
	use logger
16
}
20
}
17
21
18
checkconfig() {
22
start_pre() {
19
	local file
23
	local file
20
24
21
	for file in ${CONFIGS}; do
25
	for file in ${CONFIGS}; do
Lines 26-50 Link Here
26
	done
30
	done
27
}
31
}
28
32
29
start() {
30
	checkconfig || return 1
31
32
	ebegin "Starting ${SVCNAME}"
33
	start-stop-daemon --start --exec /usr/sbin/hostapd \
34
		-- -B ${OPTIONS} ${CONFIGS}
35
	eend $?
36
}
37
38
stop() {
39
	ebegin "Stopping ${SVCNAME}"
40
	start-stop-daemon --stop --exec /usr/sbin/hostapd
41
	eend $?
42
}
43
44
reload() {
33
reload() {
45
	checkconfig || return 1
34
	start_pre || return 1
46
35
47
	ebegin "Reloading ${SVCNAME} configuration"
36
	ebegin "Reloading ${SVCNAME} configuration"
48
	kill -HUP $(pidof /usr/sbin/hostapd) > /dev/null 2>&1
37
	kill -HUP $(cat ${pidfile}) > /dev/null 2>&1
49
	eend $?
38
	eend $?
50
}
39
}

Return to bug 505166