]>
Commit | Line | Data |
---|---|---|
b312967c MT |
1 | #!/bin/sh |
2 | ######################################################################## | |
3 | # Begin $rc_base/init.d/tor | |
4 | # | |
5 | # Description : Anonymizing overlay network for TCP | |
6 | # | |
7 | ######################################################################## | |
8 | ||
9 | . /etc/sysconfig/rc | |
10 | . ${rc_functions} | |
11 | ||
12 | case "${1}" in | |
13 | start) | |
14 | boot_mesg "Starting tor..." | |
15 | loadproc /usr/bin/tor \ | |
16 | --runasdaemon 1 \ | |
17 | --defaults-torrc /usr/share/tor/defaults-torrc \ | |
18 | -f /etc/tor/torrc \ | |
19 | --quiet | |
20 | ;; | |
21 | ||
22 | stop) | |
23 | boot_mesg "Stopping tor..." | |
24 | killproc /usr/bin/tor | |
25 | ;; | |
26 | ||
27 | reload) | |
28 | boot_mesg "Reloading tor..." | |
29 | reloadproc /usr/bin/tor | |
30 | ;; | |
31 | ||
32 | restart) | |
33 | ${0} stop | |
34 | sleep 1 | |
35 | ${0} start | |
36 | ;; | |
37 | ||
27cb7805 MT |
38 | reload-or-restart) |
39 | # Reload the process if it is already running. Otherwise, restart. | |
40 | if pidofproc -s /usr/bin/tor; then | |
41 | $0 reload | |
42 | else | |
43 | $0 restart | |
44 | fi | |
45 | ;; | |
46 | ||
b312967c MT |
47 | status) |
48 | statusproc /usr/bin/tor | |
49 | ;; | |
50 | ||
51 | *) | |
27cb7805 | 52 | echo "Usage: ${0} {start|stop|reload|restart|reload-or-restart|status}" |
b312967c MT |
53 | exit 1 |
54 | ;; | |
55 | esac | |
56 | ||
57 | # End $rc_base/init.d/tor |