[Script] Install MiniDLNA, Transmission, Ajenti and Sickbeard on WD My Cloud (firmware series 3)


#1

Please note: WD does not support installing 3rd party apps on the WD My Cloud. If you do, you do so at your own risk, and doing so can cause the UI and other things to break. If you proceed further, you are fully aware of the usual WD’s warranty void clauses including disclaimer from any damages that may resulted from this guide.

Hi together, I have created a script that will install and configure the WD Mycloud from the factory default settings, with the following applications:  

  • MiniDLNA
  • Transmissin
  • Ajenti
  • Sickbeard

The reason for the creation was, that i love to hack the MyCloud, and install applications, but it often went wrong and had to debrick it following this guide and install and configure it again new. (thanks for posting)

I created the script for my own use, so it contains some specific settings of mine, that will only work if you have the same folder structure in your shares. I used the follwowing guides (thanks for the posters):

Minidlna, Transmission; Ajenti and Sickbeard with some mnodifications.

Prerequisites:

  1. You have SSH enabled in My Cloud.
  2. You have an SSH client installed in your PC (Windows users will find Putty handy).
  3. You know the local IP address of My Cloud so you can connect to it via SSH.
  4. Your My Cloud has access to the Internet.
  5. Your My Cloud is running a firmware version prior to release 4.00.00-607. (firmware 3)
  6. Firmware auto update is disabled.

You should then be able to connect to MyCloud via SSH by using the My Cloud IP and standard port 22 with Username: root and Password: welc0me (provided you did not change it… Also notice “0” is number zero, not a capital o).

Step -1 - Switch off standard (Twonky server) DLNA support in WD control Panel:

 

Menu “Settings” -> “Media” -> “DLNA Media Server” -> switch “Media Streaming” button to “OFF” position. 
You won’t be needing two DLNA servers running simultaneously.

Step 0 - Create folder structure on your WD Public Share

Public/MiniDLNA

Public/MiniDLNA/cache

Public/MiniDLNA/log

Public/Transmission

Public/Transmission/blocklists

Public/Transmission/resume

Public/Transmission/torrents

Public/Transmission/Downloads

Step 1 - connect to your MyCloud via SSH and craete the script

nano install.sh

Copy and paste the script into nano

#!/bin/bash
cp /etc/apt/sources.list /etc/apt/sources.list.bak
apt-get update

#minidlna
apt-get -y install minidlna
sudo service minidlna stop
cp /etc/init.d/minidlna /etc/init.d/minidlna.bak
sed -i 's/PIDDIR=\/run\/$NAME/PIDDIR=\/var\/run\/$NAME/g' /etc/init.d/minidlna
cp /etc/minidlna.conf /etc/minidlna.conf.bak
sed -i 's/media_dir=\/var\/lib\/minidlna/media_dir=A,\/DataVolume\/shares\/Public\/Shared Music \nmedia_dir=P,\/DataVolume\/shares\/Public\/Shared Pictures \nmedia_dir=V,\/DataVolume\/shares\/Public\/Shared Videos \nmedia_dir=V,\/DataVolume\/shares\/Public\/Transmission\/Downloads/g' /etc/minidlna.conf
sed -i 's/#db_dir=\/var\/lib\/minidlna/db_dir=\/DataVolume\/shares\/Public\/MiniDLNA\/cache/g' /etc/minidlna.conf
sed -i 's/#log_dir=\/var\/log/log_dir=\/DataVolume\/shares\/Public\/MiniDLNA\/log/g' /etc/minidlna.conf
sed -i 's/#presentation_url=http:\/\/example.com:80/presentation_url=http:\/\/192.168.0.15:8200/g' /etc/minidlna.conf
sed -i 's/#inotify=yes/inotify=yes/g' /etc/minidlna.conf
usermod -a -G share minidlna
service minidlna start

#transmission
apt-get -y install transmission-cli transmission-common transmission-daemon
/etc/init.d/transmission-daemon stop
cp /etc/transmission-daemon/settings.json /etc/transmission-daemon/settings.json.bak
sed -i 's/USER=debian-transmission/USER=root /g' /etc/init.d/transmission-daemon
sed -i 's/"rpc-authentication-required": true,/"rpc-authentication-required": false,/g' /etc/transmission-daemon/settings.json
sed -i 's/"rpc-whitelist-enabled": true,/"rpc-whitelist-enabled": false,/g' /etc/transmission-daemon/settings.json
sed -i 's/\/var\/lib\/transmission-daemon\/downloads/\/DataVolume\/shares\/Public\/Transmission\/Downloads/g' /etc/transmission-daemon/settings.json
sed -i 's/"utp-enabled": true/"utp-enabled": true,/g' /etc/transmission-daemon/settings.json
sed -i 's/}/"watch-dir": "\/DataVolume\/shares\/Public\/Transmission\/torrents", \n"watch-dir-enabled": true \n}/g' /etc/transmission-daemon/settings.json
rmdir /var/lib/transmission-daemon/info/blocklists
ln -s /DataVolume/shares/Public/Transmission/blocklists /var/lib/transmission-daemon/info/blocklists
rmdir /var/lib/transmission-daemon/info/resume
ln -s /DataVolume/shares/Public/Transmission/resume /var/lib/transmission-daemon/info/resume
rmdir /var/lib/transmission-daemon/info/torrents
ln -s /DataVolume/shares/Public/Transmission/torrents /var/lib/transmission-daemon/info/torrents
/etc/init.d/transmission-daemon start

#ajenti
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/debian main main debian" >> /etc/apt/sources.list
apt-get update && apt-get -y install ajenti
service ajenti restart

#sickbeard
cd /usr/share/
wget http://pypi.python.org/packages/source/C/Cheetah/Cheetah-2.4.4.tar.gz
tar -zxvf Cheetah-2.4.4.tar.gz
rm -f Cheetah-2.4.4.tar.gz
cd Cheetah-2.4.4
python setup.py install
wget https://github.com/midgetspy/Sick-Beard/tarball/master
mv master sickbeard.tar.gz
tar -xzvf sickbeard.tar.gz
rm -f sickbeard.tar.gz
mv midgetspy* sickbeard
echo '#!/bin/sh 
#Required -- Defaults Provided (only change if you know you need to).
HOST="0.0.0.0" #Set Sick Beard address here.
PORT="8081" #Set Sick Beard port here.
 
#Optional -- Unneeded unless you have added a user name and password to Sick Beard.
SBUSR="" #Set Sick Beard user name (if you use one) here.
SBPWD="" #Set Sick Beard password (if you use one) here.
 
#Script -- No changes needed below.
case "$1" in
start)
PATH=$PATH:/usr/bin:/usr/sbin
echo "Starting Sickbeard."
# use /usr/bin/python2.7/ if you skipped the Python update!
/usr/bin/python2.7 /usr/share/sickbeard/SickBeard.py -q > /dev/null 2>&1 &
;;
stop)
#Shutdown Sick Beard and delete the index.html files that wget generates.
echo "Stopping Sick Beard"
wget -q --user=$SBUSR --password=$SBPWD "http://$HOST:$PORT/home/shutdown/" --delete-after
sleep 6s
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
 
exit 0' > /etc/init.d/sickbeard
chmod 755 /etc/init.d/sickbeard
update-rc.d sickbeard defaults
/etc/init.d/sickbeard start
apt-get -y install subversion
svn checkout https://github.com/patrickdessalle/periscope periscope-read-only
apt-get -y install python-setuptools python-beautifulsoup
cd periscope-read-only/trunk
python setup.py install
cd /usr/share/sickbeard
echo '#!/bin/sh
echo Filename to process. $1
echo Original filename... $2
echo Show TVDB id........ $3
echo Season number....... $4
echo Episode number...... $5
echo Episode air date.... $6
echo ... will now pass the search info to periscope to snatch a subtitle
/usr/local/bin/periscope "$1" -l hu -l en --force' > searchSubs.sh
chmod 755 searchSubs.sh
sudo /etc/init.d/sickbeard stop
sed -i 's/extra_scripts = ""/extra_scripts = "\/usr\/share\/sickbeard\/searchSubs.sh"/g' /usr/share/sickbeard/config.ini
sudo /etc/init.d/sickbeard start
mv -f /etc/apt/sources.list.bak /etc/apt/sources.list

 Press crt+X to exit and Y to save.

Step 2 - Permissions

chmod 777 install.sh

Step 3 - Execute script

./install.sh

Now you have to wait until the script finishes.

The installation is Done and the basic configuration.

Notes for Applications

MiniDLNA:

For detailed info and guide: http://community.wd.com/t5/WD-My-Cloud/GUIDE-Install-MiniDLNA-on-WD-My-Cloud-firmware-series-3/td-p/755364

BEAR IN MIND

 

You should turn firmware automatic updates off and backup configuration files in case you futurely update the NAS firmware and need to reinstall MiniDLNA.

The above works for files publicly accessible by everyone. Should you wish MiniDLNA to index and serve files included in directories of particular users you will need to tweak permissions.

USEFUL COMMANDS

 

service minidlna stop //stops daemon
service minidlna start //starts daemon

minidlnad  //same as previous (starts daemon)
service minidlna force-reload  //forces cleaning the database and starting fresh

FURTHER NOTES

 

Accessing the following URL in a browser will show a summary of indexed files and connected clients: 
http://YOUR.WD.MYCLOUD.IP:8200
[Replace YOUR.WD.MYCLOUD.IP by whatever IP your My Cloud has on LAN (local network)]

Transmission:

For detailed info and guide: http://community.wd.com/t5/WD-My-Cloud/GUIDE-Transmission-2-82/td-p/619597

Login to the Transmission GUI

Your mycloud ip or network name :9091

Ajenti:

For detailed info and guide: http://community.wd.com/t5/WD-My-Cloud/GUIDE-Ajenti-Remote-Server-Administration/m-p/620195/highlight/true#M1363

You can now log into Ajenti using a secure https connection…Your browser may ask you to add an exception

https:// your MyCloud IP or Network Name :8000

Username: root

Password: admin

Sickbeard:

For detailed info and guide:  http://community.wd.com/t5/WD-My-Cloud/GUIDE-Sickbeard-on-MyCloud/m-p/626963/highlight/true#M1959

Now in your web browser go to your MYCLOUD name or ip:8081

Set it all up


#2

Hello,

Thank you for sharing this information and also for posting the warning:

"Please note: WD does not support installing 3rd party apps on the WD My Cloud. If you do, you do so at your own risk, and doing so can cause the UI and other things to break. ** If you proceed further, you are fully aware of the usual WD’s _warranty void _clauses including disclaimer from any damages that may resulted from this guide."**