    #!/ffp/bin/sh

    # PROVIDE: Transmission

    . /ffp/etc/ffp.subr

    TRANSMISSION_HOME=/ffp/tm/.transmission-daemon

    name="transmission-daemon"
    command="/ffp/bin/$name"
    start_cmd="transmission_start"
    stop_cmd="transmission_stop"
    status_cmd="transmission_status"
    user=root
    su_cmd="/ffp/bin/su"

    transmission_start()
    {
       if [ ! -d ${TRANSMISSION_HOME} ]; then
          $su_cmd $user -c "mkdir ${TRANSMISSION_HOME}"
       fi
       echo "Starting $name"
          $su_cmd $user -c "$command -g ${TRANSMISSION_HOME} -e ${TRANSMISSION_HOME}/$name.log"
    }

    transmission_stop()
    {
       echo "Stopping $name"
          /ffp/bin/killall -SIGINT $name
    }

    transmission_status()
    {
       _pids=$(pidof $name)
       if test -n "$_pids"; then
          echo "$name is running, pid:"
          pidof $name
       else
          echo "$name not running"
       fi
    }

    run_rc_command "$1"
