source: packages/net/tor/files/tor.init @ 21451

Last change on this file since 21451 was 21451, checked in by swalker, 6 years ago

[packages] tor: better log directory permissions

  • Property svn:eol-style set to native
File size: 589 bytes
Line 
1#!/bin/sh /etc/rc.common
2# Copyright (C) 2006 OpenWrt.org
3START=50
4
5BIN=tor
6DEFAULT=/etc/default/$BIN
7LOG_D=/var/log/$BIN
8LIB_D=/var/lib/$BIN
9RUN_D=/var/run
10PID_F=$RUN_D/$BIN.pid
11RUN_USER=$BIN
12RUN_GROUP=$BIN
13
14start() {
15        [ -f $DEFAULT ] && . $DEFAULT
16        [ -d $LOG_D ] || ( mkdir -m 0755 -p $LOG_D && chown $RUN_USER:$RUN_GROUP $LOG_D )
17        [ -d $LIB_D ] || ( mkdir -m 0700 -p $LIB_D && chown $RUN_USER:$RUN_GROUP $LIB_D )
18        [ -d $RUN_D ] || mkdir -p $RUN_D
19        [ -f $PID_F ] || ( touch $PID_F && chown $RUN_USER:$RUN_GROUP $PID_F )
20        $BIN $OPTIONS
21}
22
23stop() {
24        [ -f $PID_F ] && kill $(cat $PID_F)
25}
26
Note: See TracBrowser for help on using the repository browser.