Changes between Version 14 and Version 15 of Scripts/initd


Ignore:
Timestamp:
Jan 10, 2009, 2:09:30 PM (12 years ago)
Author:
Waldorf
Comment:

Some trivial changes like allowing arguments to be passed to t-daemon

Legend:

Unmodified
Added
Removed
Modified
  • Scripts/initd

    v14 v15  
    3131### END INIT INFO
    3232
     33# Original Author: Lennart A. JÃŒtte, based on Rob Howell's script
     34# Modified by Maarten Van Coile & others (on IRC)
     35
    3336# Do NOT "set -e"
    3437
     
    4245# For the available environement variables, visit:
    4346# http://trac.transmissionbt.com/wiki/EnvironmentVariables
    44 
    45 # The name of the user that should run Transmission
     47#
     48# The name of the user that should run Transmission.
     49# It's RECOMENDED to run Transmission in it's own user,
     50# by default, this is is set to 'transmission'.
     51# For the sake of security you shouldn't set a password
     52# on this user
    4653USERNAME=transmission
    4754
     
    5057# Only change these options if you know what you are doing!
    5158#
    52 # The folder where Transmission stores the config & web files
     59# The folder where Transmission stores the config & web files.
    5360# ONLY change this you have it at a non-default location
    5461#TRANSMISSION_HOME="/var/config/transmission-daemon"
    5562#TRANSMISSION_WEB_HOME="/usr/local/share/"
     63#
     64# The arguments passed on to transmission-daemon.
     65# ONLY change this you need to, otherwise use the
     66# settings file as per above.
     67#TRANSMISSION_ARGS=""
    5668
    5769
     
    8597do_start()
    8698{
    87         # Export the configuration/web directory, if set
    88         if [ -n "$TRANSMISSION_HOME" ]; then
    89               export TRANSMISSION_HOME
    90         fi
    91         if [ -n "$TRANSMISSION_WEB_HOME" ]; then
    92               export TRANSMISSION_WEB_HOME
    93         fi
     99    # Export the configuration/web directory, if set
     100    if [ -n "$TRANSMISSION_HOME" ]; then
     101          export TRANSMISSION_HOME
     102    fi
     103    if [ -n "$TRANSMISSION_WEB_HOME" ]; then
     104          export TRANSMISSION_WEB_HOME
     105    fi
    94106
    95         # Return
    96         #   0 if daemon has been started
    97         #   1 if daemon was already running
    98         #   2 if daemon could not be started
    99         start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON \
    100                 --test -- $TRANSMISSION_ARGS > /dev/null \
    101                 || return 1
    102         start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON \
    103                 || return 2
     107    # Return
     108    #   0 if daemon has been started
     109    #   1 if daemon was already running
     110    #   2 if daemon could not be started
     111    start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON \
     112            --test -- $TRANSMISSION_ARGS > /dev/null \
     113            || return 1
     114    start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --exec $DAEMON \
     115            -- $TRANSMISSION_ARGS \
     116            || return 2
    104117}
    105118