]>
Commit | Line | Data |
---|---|---|
501e7b86 MT |
1 | #!/bin/bash |
2 | ############################################################################ | |
3 | # # | |
4 | # This file is part of the IPFire Firewall. # | |
5 | # # | |
6 | # IPFire is free software; you can redistribute it and/or modify # | |
7 | # it under the terms of the GNU General Public License as published by # | |
8 | # the Free Software Foundation; either version 2 of the License, or # | |
9 | # (at your option) any later version. # | |
10 | # # | |
11 | # IPFire is distributed in the hope that it will be useful, # | |
12 | # but WITHOUT ANY WARRANTY; without even the implied warranty of # | |
13 | # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # | |
14 | # GNU General Public License for more details. # | |
15 | # # | |
16 | # You should have received a copy of the GNU General Public License # | |
17 | # along with IPFire; if not, write to the Free Software # | |
18 | # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # | |
19 | # # | |
4680d554 | 20 | # Copyright (C) 2007-2019 IPFire-Team <info@ipfire.org>. # |
501e7b86 MT |
21 | # # |
22 | ############################################################################ | |
23 | # | |
24 | . /opt/pakfire/lib/functions.sh | |
4680d554 PM |
25 | |
26 | # Run Tor as dedicated user and make sure user and group exist | |
27 | if ! getent group tor &>/dev/null; then | |
28 | groupadd -g 119 tor | |
29 | fi | |
30 | ||
31 | if ! getent passwd tor; then | |
a10b0e5b | 32 | useradd -u 119 -g tor -c "Tor daemon user" -d /var/empty -s /bin/false tor |
4680d554 PM |
33 | fi |
34 | ||
fa7de475 PM |
35 | extract_files |
36 | restore_backup ${NAME} | |
37 | ||
a10b0e5b PM |
38 | # Adjust some folder permission for new UID/GID |
39 | chown -R tor:tor /var/lib/tor /var/ipfire/tor | |
40 | ||
9a0454ce | 41 | # Tor settings file needs to be writeable by nobody group for WebUI |
42 | chown tor:nobody /var/ipfire/tor/settings | |
43 | chmod 664 /var/ipfire/tor/settings | |
44 | ||
501e7b86 | 45 | start_service --background ${NAME} |