Disclaimer:The following init.d scripts assume some linux knowledge and that your Synology NAS device has been bootstrapped allowing you to install the required dependancies using ipkg.

These instructions do not describe how to download, install or configure SABnzbd, Sickbeard or CouchPotato. All init.d scripts have been tested and work fine on a Synology 411+ running DSM 3.1. All init.d scripts expect certain packages to be installed in order to work correctly.

These scripts should be placed in /opt/etc/init.d/ and be given the same filenames and permissions as shown below.

All init.d scripts require some values to be defined by you in order to work correctly.

Required Packages

  • openssl
  • py26-cheetah
  • py26-openssl
  • python26
  • wget

SABnzbd – /opt/etc/init.d/S99sabnzbd.sh (rwxr-xr-x)
Download: S99sabnzbd.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
#!/bin/sh
#
# Synology DSM init script for SABnzbd
# Requires: sabnzbd
#           python
#           wget
#
# Configured Variables:
#
PYTHON_EXEC="/opt/bin/python2.6"
SABNZBD_EXEC="/opt/share/sabnzbd/SABnzbd.py"
SABNZBD_PORT="9200"
SAB_API_KEY="YOUR API KEY GOES HERE"
SAB_INI_FILE="ABSOLUTE PATH TO sabnzbd.ini"
 
# Begin script
#
case "$1" in
start)
  PATH=$PATH:/opt/bin
  printf "%-30s" "Starting SABnzbd"
  ${PYTHON_EXEC} ${SABNZBD_EXEC} -s 0.0.0.0:${SABNZBD_PORT} -f ${SAB_INI_FILE} -d
  printf "[%4s]\n" "done"
  ;;
stop)
  printf "%-30s" "Stopping SABnzbd"
  /opt/bin/wget -q --delete-after "http://127.0.0.1:${SABNZBD_PORT}/shutdown?session=${SAB_API_KEY}"
  printf "[%4s]\n" "done"
  ;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac
 
exit 0

SickBeard – /opt/etc/init.d/S99sickbeard.sh (rwxr-xr-x)
Download: S99sickbeard.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#
# Synology DSM init script for SickBeard
# Requires: sickbeard
#           python
#           wget
#
# Configured Variables:
#
PYTHON_EXEC="/opt/bin/python2.6"
SICKBEARD_EXEC="/opt/share/sickbeard/SickBeard.py"
SICKBEARD_PORT="9201"
 
# Begin script
#
case "$1" in
start)
  printf "%-30s" "Starting SickBeard"
  nohup ${PYTHON_EXEC} ${SICKBEARD_EXEC} -q -d > /dev/null 2>&1 &
  printf "[%4s]\n" "done"
  ;;
stop)
  printf "%-30s" "Stopping SickBeard"
  /opt/bin/wget -q --delete-after "http://127.0.0.1:${SICKBEARD_PORT}/home/shutdown/"
  printf "[%4s]\n" "done"
  ;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac
 
exit 0

CouchPotato – /opt/etc/init.d/S99couchpotato.sh (rwxr-xr-x)
Download: S99couchpotato.sh

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/sh
#
# Synology DSM init script for CouchPotato
# Requires: couchpotato
#           python
#           wget
#
# Configured Variables:
#
PYTHON_EXEC="/opt/bin/python2.6"
COUCHPOTATO_EXEC="/opt/share/couchpotato/CouchPotato.py"
COUCHPOTATO_PORT="9203"
 
# Begin script
#
case "$1" in
start)
  printf "%-30s" "Starting CouchPotato"
  ${PYTHON_EXEC} ${COUCHPOTATO_EXEC} -d &
  printf "[%4s]\n" "done"
  ;;
stop)
  printf "%-30s" "Stopping CouchPotato"
  /opt/bin/wget -q --delete-after "http://127.0.0.1:${COUCHPOTATO_PORT}/config/exit/"
  printf "[%4s]\n" "done"
  ;;
*)
  echo "Usage: $0 {start|stop}"
  exit 1
esac
 
exit 0

If you find this helpful or found a problem with any of the scripts let me know in the comments section below.

Tagged with: