You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

28 lines
606 B

  1. #!/bin/sh /etc/rc.common
  2. # Copyright (C) 2006-2011 OpenWrt.org
  3. START=50
  4. STOP=50
  5. USE_PROCD=1
  6. start_service() {
  7. user_exists tor 52 || user_add tor 52 52 /var/lib/tor
  8. group_exists tor 52 || group_add tor 52
  9. [ -f /var/run/tor.pid ] || {
  10. touch /var/run/tor.pid
  11. chown tor:tor /var/run/tor.pid
  12. }
  13. [ -d /var/lib/tor ] || {
  14. mkdir -m 0755 -p /var/lib/tor
  15. chmod 0700 /var/lib/tor
  16. chown tor:tor /var/lib/tor
  17. }
  18. [ -d /var/log/tor ] || {
  19. mkdir -m 0755 -p /var/log/tor
  20. chown tor:tor /var/log/tor
  21. }
  22. procd_open_instance
  23. procd_set_param command /usr/sbin/tor --runasdaemon 0
  24. procd_close_instance
  25. }