gettor_service 1.21 KB
Newer Older
1
2
3
4
5
6
7
8
9
10
11
12
#!/bin/bash
#
# This file is part of GetTor, a Tor Browser distribution system.
#
# :authors: isra <ilv@torproject.org>
#           see also AUTHORS file
#
# :copyright:   (c) 2008-2014, The Tor Project, Inc.
#               (c) 2014-2018, Israel Leiva
#
# :license: This is Free Software. See LICENSE for license information.

Hiro's avatar
Hiro committed
13
14
15
16
17
18
19
20

################################################################################
#                                                                              #
# This is how GetTor is started as a twisted application.                      #
# The script allows to start, stop, restart GetTor and get its status.         #
#                                                                              #
################################################################################

21
22
case "$1" in
start)
Hiro's avatar
Hiro committed
23
   twistd3 --python=scripts/gettor --logfile=log/gettor.log --pidfile=gettor.pid
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
   ;;
stop)
   kill -INT `cat gettor.pid`
   ;;
restart)
   $0 stop
   sleep 2;
   $0 start
   ;;
status)
   if [ -e gettor.pid ]; then
      echo gettor is running with pid=`cat gettor.pid`
   else
      echo gettor is NOT running
      exit 1
   fi
   ;;
*)
   echo "Usage: $0 {start|stop|status|restart}"
esac

exit 0