2006-10-04 20:57:49 +00:00
|
|
|
#!/bin/sh /etc/rc.common
|
2011-11-09 23:17:24 +00:00
|
|
|
# Copyright (C) 2006-2011 OpenWrt.org
|
|
|
|
|
2007-05-10 10:38:53 +00:00
|
|
|
START=50
|
2011-11-16 09:44:20 +00:00
|
|
|
STOP=50
|
2006-08-10 21:44:54 +00:00
|
|
|
|
2011-11-16 09:44:20 +00:00
|
|
|
SERVICE_USE_PID=1
|
2006-08-10 21:44:54 +00:00
|
|
|
|
2006-10-04 20:57:49 +00:00
|
|
|
start() {
|
2011-11-16 09:44:20 +00:00
|
|
|
user_exists tor 52 || user_add tor 52 52 /var/lib/tor
|
2011-11-09 23:17:24 +00:00
|
|
|
group_exists tor 52 || group_add tor 52
|
2011-11-16 09:44:20 +00:00
|
|
|
[ -f /var/run/tor.pid ] || {
|
|
|
|
touch /var/run/tor.pid
|
|
|
|
chown tor:tor /var/run/tor.pid
|
2011-11-09 23:17:24 +00:00
|
|
|
}
|
|
|
|
[ -d /var/lib/tor ] || {
|
|
|
|
mkdir -m 0755 -p /var/lib/tor
|
|
|
|
chmod 0700 /var/lib/tor
|
|
|
|
chown tor:tor /var/lib/tor
|
|
|
|
}
|
|
|
|
[ -d /var/log/tor ] || {
|
|
|
|
mkdir -m 0755 -p /var/log/tor
|
|
|
|
chown tor:tor /var/log/tor
|
|
|
|
}
|
2011-11-16 09:44:20 +00:00
|
|
|
service_start /usr/sbin/tor --PidFile /var/run/tor.pid
|
2006-10-04 20:57:49 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
stop() {
|
2011-11-09 23:17:24 +00:00
|
|
|
service_stop /usr/sbin/tor
|
2006-10-04 20:57:49 +00:00
|
|
|
}
|