aboutsummaryrefslogtreecommitdiffstats
path: root/testing/wicd/wicd.initd
blob: 071f3fd52a754d2b060fbdbd5cb6db796ac19ee7 (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
#!/sbin/openrc-run
## Copyright 1999-2006 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2

WICD_DAEMON=/usr/sbin/wicd
WICD_PIDFILE=/var/run/wicd/wicd.pid

depend() {
	need dbus
	after hald
	provide net
}

start() {
	ebegin "Starting wicd daemon"
	[ -f /etc/wicd/wired-settings.conf ] && sed -i 's/^\[\]$//' /etc/wicd/wired-settings.conf
	"${WICD_DAEMON}" >/dev/null 2>&1
	eend $?
}

stop() {
	ebegin "Stopping wicd daemon and closing connections"
	"${WICD_DAEMON}" -k >/dev/null 2>&1
	eend $?
}

force_kill() {
	ebegin "Stopping wicd daemon"
	start-stop-daemon --stop --pidfile "${WICD_PIDFILE}"
	eend $?
}

restart() {
	force_kill
	start
}