#Change TMP Folder to have more space!
TMPFOLDER=‘/shares/Public/tmpCompile’
TMP=$TMPFOLDER
TEMP=$TMPFOLDER
TMPDIR=$TMPFOLDER
export TMPDIR TMP TEMP
clear
echo “Welcome! Compile and Install Transmission 2.84”
echo “Created by Proglin v2015-09-10”
echo " Last Update: v2019-06-13"
echo “ALWAYS back up your data before proceeding.”
echo “This script was only tested with MyBookLive firmware 02.43.10-048”
printf "Your firmware version is: “;tail -1 /var/log/version.log
echo “”
echo “NOTE from Author: I have not MyBookLive since 2016. Changes after 2016 are based”
echo " on user forum comments.”
echo “”
echo “We are going to change some configs to install Tranmission”
read -p “This process takes around 30 minutes. Are you sure? (Y/N)” -n 1 -r
echo # (optional) move to a new line
if [[ $REPLY =~ [1]$ ]]
then
echo “OK. Exiting.”
exit
fi
mkdir -p $TMPFOLDER
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
fi
rm -f /var/lib/dpkg/info/wd-nas.*
cp /etc/apt/sources.list $TMPFOLDER/sources.list.bak
echo “”
printf “1/22 Configuring repositories… (part 1/3)”
APTSOURCESOLD=“#Modified to install Transmission (old packages)
deb Index of /debian squeeze main
deb-src Index of /debian squeeze main #debIndex of /debian wheezy main #deb-srcIndex of /debian wheezy main\n”
printf “$APTSOURCESOLD” > /etc/apt/sources.list
apt-get -qq clean
apt-get -qq update >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “2/22 Installing packages… (part 1/7)”
apt-get -q -y --force-yes --allow-unauthenticated -o Dpkg::Options::=“–force-confdef” -o Dpkg::Options::=“–force-confold” -o Dpkg::Options::=“–force-overwrite” install tar >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “3/22 Installing packages… (part 2/7)”
apt-get -q -y --force-yes --allow-unauthenticated -o Dpkg::Options::=“–force-confdef” -o Dpkg::Options::=“–force-confold” -o Dpkg::Options::=“–force-overwrite” install ca-certificates >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “4/22 Installing packages… (part 3/7)”
apt-get -q -y --force-yes --allow-unauthenticated -o Dpkg::Options::=“–force-confdef” -o Dpkg::Options::=“–force-confold” -o Dpkg::Options::=“–force-overwrite” install intltool >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “5/22 Installing packages… (part 4/7)”
apt-get -q -y --force-yes --allow-unauthenticated -o Dpkg::Options::=“–force-confdef” -o Dpkg::Options::=“–force-confold” -o Dpkg::Options::=“–force-overwrite” install build-essential >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “6/22 Installing packages… (part 5/7)”
apt-get -q -y --force-yes --allow-unauthenticated -o Dpkg::Options::=“–force-confdef” -o Dpkg::Options::=“–force-confold” -o Dpkg::Options::=“–force-overwrite” install libtool >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “7/22 Configuring repositories… (part 2/3)”
APTSOURCESNEW=“#Modified to install Transmission (new packages) #debIndex of /debian squeeze main #deb-srcIndex of /debian squeeze main
deb Index of /debian wheezy main
deb-src Index of /debian wheezy main\n”
printf “$APTSOURCESNEW” > /etc/apt/sources.list
apt-get -qq clean
apt-get -qq update 2>/dev/null
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “9/22 Configuring repositories… (part 3/3)”
APTSOURCESOLD=“#Modified to install Transmission (old packages)
deb Index of /debian squeeze main
deb-src Index of /debian squeeze main #debIndex of /debian wheezy main #deb-srcIndex of /debian wheezy main\n”
printf “$APTSOURCESOLD” > /etc/apt/sources.list
apt-get -qq clean
apt-get -qq update >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
printf “10/22 Installing packages… (part 7/7)”
apt-get -q -y --force-yes --allow-unauthenticated -o Dpkg::Options::=“–force-confdef” -o Dpkg::Options::=“–force-confold” -o Dpkg::Options::=“–force-overwrite” install libcurl4-openssl-dev >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
do_start()
{
# Export the configuration/web directory, if set
if [ -n “$TRANSMISSION_HOME” ]; then
export TRANSMISSION_HOME
fi
if [ -n “$TRANSMISSION_WEB_HOME” ]; then
export TRANSMISSION_WEB_HOME
fi
# Return
# 0 if daemon has been started
# 1 if daemon was already running
# 2 if daemon could not be started
start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON --background --test -- -f $TRANSMISSION_ARGS > /dev/null \
|| return 1
start-stop-daemon --chuid $USERNAME --start --pidfile $PIDFILE --make-pidfile \
--exec $DAEMON --background -- -f $TRANSMISSION_ARGS \
|| return 2
}
Function that stops the daemon/service
do_stop()
{
# Return
# 0 if daemon has been stopped
# 1 if daemon was already stopped
# 2 if daemon could not be stopped
# other if a failure occurred
start-stop-daemon --stop --quiet --retry=TERM/10/KILL/5 --pidfile $PIDFILE --exec $DAEMON
RETVAL=“$?”
[ “$RETVAL” = 2 ] && return 2
# Wait for children to finish too if this is a daemon that forks
# and if the daemon is only ever run from this initscript.
# If the above conditions are not satisfied then add some other code
# that waits for the process to drop all resources that could be
# needed by services started subsequently. A last resort is to
# sleep for some time.
start-stop-daemon --stop --quiet --oknodo --retry=0/30/KILL/5 --exec $DAEMON
[ "$?" = 2 ] && return 2
# Many daemons don't delete their pidfiles when they exit.
rm -f $PIDFILE
return "$RETVAL"
}
case “$1” in
start)
echo “Starting $DESC” “$NAME…”
do_start
case “$?” in
0|1) echo " Starting $DESC $NAME succeeded" ;;
*) echo " Starting $DESC $NAME failed" ;;
esac
;;
stop)
echo “Stopping $DESC $NAME…”
do_stop
case “$?” in
0|1) echo " Stopping $DESC $NAME succeeded" ;;
*) echo " Stopping $DESC $NAME failed" ;;
esac
;;
restart|force-reload)
#
# If the “reload” option is implemented then remove the
# ‘force-reload’ alias
#
echo “Restarting $DESC $NAME…”
do_stop
case “$?” in
0|1)
do_start
case “$?” in
0|1) echo " Restarting $DESC $NAME succeeded" ;;
*) echo " Restarting $DESC $NAME failed: couldn’t start $NAME" ;;
esac
;;
*)
echo " Restarting $DESC $NAME failed: couldn’t stop $NAME" ;;
esac
;;
*)
echo “Usage: $SCRIPTNAME {start|stop|restart|force-reload}” >&2
exit 3
;;
esac
EOF
#Setting TRANSMISSION to auto startup
printf “19/22 Configuring TRANSMISSION to auto startup”
printf “$INITD” > /etc/init.d/transmission-daemon
chmod +x /etc/init.d/transmission-daemon
chown root:root /etc/init.d/transmission-daemon #Adding autostart to transmission
update-rc.d transmission-daemon defaults >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
else
echo " OK!"
fi
#Starting TRANSMISSION
printf “20/22 Configuring TRANSMISSION settings.json”
/etc/init.d/transmission-daemon start >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
fi
#Wait transmission to create config files structure
sleep 5
/etc/init.d/transmission-daemon stop >/dev/null 2>&1
if [[ $? > 0 ]]
then
echo “The command failed, exiting.” ; exit
fi
miniDLNA uses Lib6 and Transmission uses it to, but I think it might run without problem. I´ve never tested.
Transmission runs smooth. No problem using with regular access to MBL files. Since I compiled it, I´m downloading torrents. My last version (2.82), as post above said, go to sleep normally if there is no torrents working. I can tell you after my torrents finish
Really nice guide! Everything seems to work just fine. I can access transmission web interface through my browser (chrome) on my PC but I can’t seem to access it though my phone.
When I type in http://mybooklive:9091 in my phone’s browser (chrome) all I get is “ERR_NAME_NOT_RESOLVED”.
Is there anyway to solve this? It Would be nice to add torrent’s through your phone. I have used many remote torrent apps but no one seems to be able to let me choose the download paths.
When I type in http://mybooklive:9091 in my phone’s browser (chrome) all I get is “ERR_NAME_NOT_RESOLVED”.
Is your phone on the local network or on teh celluar network? Most likley the latter, so how could it access an internal IP address? it can’t. You need to setup remote access - which involves port forwarding and a static external IP or at least a dydns.
As wdlive76 said you need to check if you are using your local network. Otherwise you will need to make it public over the internet (It isn´t trivial to do)
BTW I have never tried to access directly http://mybooklive:9091 from my mobile. I use this free app:
You can change this values using client web interface, but they’ll be gone every time that you reboot you MBL. To make it persitent you need to follow the link above. (stop transmission, edtit file, start transmission)
Thanks for the guide! However, I’m having problems using the script - I get a ‘command not found’ error several times when running it - including on lines 45, 52, 70, 79, 88, 97, 106 (amongst many others) so it basically seems to have a problem with the ‘If’ command. What could be the problem?
Hi Proglin - thanks for the help! It turned out to be an issue with spaces - apparently there needed to be spaces after square brackets at the beginning of the statements, so “if [[$REPLY =~ [1]$ ]]” needed to be “if [[ $REPLY =~ [2]$ ]]”. Having gone through the whole script and changed them all it now works fine! Not sure why that has been a problem for me and nobody else but discovering that has also helped me with a couple of other scripts that weren’t working.
That explains another problem I’m having - other scripts/bits of code that I’ve been trying to copy and paste from this forum have also not been parsed correctly, like some of them appear all on one line, with no carriage returns/paragraph breaks. For example, I’ve been trying to setup Couch Potato (to use with Transmission) using this guide here - [GUIDE] CouchPotato V2 on MBL
And I get to the step where you create the startup script and it says ‘Paste this’ but then everything is all on one line, so it doesn’t work. I’ve tried parsing it myself but I don’t understand it well enough to get it exactly right. It did occur to me that it might just be my PC or browser but if the forum has changed software since these guides were written then that must be the cause!
Yes can we make a stink about this issue please because it caused me to waste a lot of time, and i still haven’t got couchpotato or transmission auto-starting! Cheers