summaryrefslogtreecommitdiffstats
path: root/testing/tor/tor.initd
blob: 4a26c1dad5e2483fc6c12123838ea0e62bb45b2c (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
#!/sbin/runscript

# Sample init.d file for alpine linux.

name=tor
daemon=/usr/bin/$name

depend() {
	need net
	after firewall
        provide $name
}

start() {
	ebegin "Starting ${name}"
		start-stop-daemon --start --quiet \
			--pidfile /var/run/${name}.pid \
			-u ${name} \
			--exec ${daemon} -- --runasdaemon 1
	eend $?
}

stop() {
	ebegin "Stopping ${name}"
		start-stop-daemon --stop --quiet \
			--pidfile /var/run/$name.pid \
			--exec ${daemon}
	eend $?
}