~usmteam/usm/usm_torrents

« back to all changes in this revision

Viewing changes to usr/share/usm/plugins/usm_torrents/transmissiond

  • Committer: Oliver M
  • Date: 2009-03-06 11:30:11 UTC
  • Revision ID: oly@digitaloctave.com-20090306113011-5deoudxfcxoppys2
inital commit, can add remove pause torrents.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/bash
 
2
#### BEGIN INIT INFO
 
3
# Short-Description: init script for Transmission Daemon
 
4
# Description:       init script for Transmission Daemon
 
5
### END INIT INFO
 
6
#
 
7
# Author:       usmteam
 
8
###
 
9
 
 
10
set -e
 
11
 
 
12
PATH=/usr/sbin:/usr/bin:/sbin:/bin
 
13
DESC="Transmission Daemon"
 
14
NAME=transmission-daemon
 
15
DAEMON=/usr/bin/transmission-daemon
 
16
DAEMONPATH=/home/
 
17
DAEMON_ARGS=""
 
18
PIDFILE=/var/run/$NAME.pid
 
19
SCRIPTNAME=/etc/init.d/$NAME
 
20
 
 
21
. /lib/lsb/init-functions
 
22
 
 
23
case "$1" in
 
24
    start)
 
25
        log_daemon_msg "Starting up" "Transmission Torrent Service !!"
 
26
        #start_daemon $DAEMON
 
27
        # Return
 
28
        #   0 if daemon has been started
 
29
        #   1 if daemon was already running
 
30
        #   2 if daemon could not be started
 
31
        start-stop-daemon --start --quiet --background --chdir $DAEMONPATH --pidfile $PIDFILE --exec $DAEMON --test > /dev/null \
 
32
                || return 1
 
33
        start-stop-daemon --start --quiet --background --chdir $DAEMONPATH --pidfile $PIDFILE --exec $DAEMON -- \
 
34
                $DAEMON_ARGS \
 
35
                || return 2
 
36
        # Add code here, if necessary, that waits for the process to be ready
 
37
        # to handle requests from services started subsequently which depend
 
38
        # on this one.  As a last resort, sleep for some time.
 
39
 
 
40
        log_end_msg $?
 
41
    ;; 
 
42
  stop)
 
43
        log_daemon_msg "Shutting down " "Transmission Torrent Service !!"
 
44
        #killproc $DAEMON
 
45
        start-stop-daemon --stop --oknodo --quiet --exec $DAEMON
 
46
        log_end_msg $?
 
47
    ;;
 
48
  force-reload|restart)
 
49
    $0 stop
 
50
    $0 start
 
51
    ;;
 
52
  *)
 
53
    echo "Usage: /etc/init.d/transmissiond {start|stop|restart|force-reload}"
 
54
    exit 1
 
55
    ;;
 
56
esac
 
57
 
 
58
exit 0