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:  

Unboxing the eeePC

On October 4, 2008, in posts, by Michael

So for some of you who know me, I’ve been going on about the eeePC laptop for sometime and I recently (today) received a free eeePC 4G Surf from my bank. As I switched to some new account type and jumped through all their hoops. Needless to say I am pretty pleased so far and can’t wait to get hacking on this thing. Enough with the talk, on with the pictures.

Tagged with:  

mkdvdiso

On June 9, 2008, in scripts, by Michael

A simple perl script utilizing mkisofs that takes a VIDEO_TS directory full of vobs and creates a dvd iso image. It needs a bit of further modification to make it more robost, but the basics are there and its fully usable.

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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
#!/usr/bin/perl
#
# a script to create dvd iso images using mkisofs
# created by: Michael Sutherland, May 22, 2008
#
 
use warnings;
use strict;
use Getopt::Long;
 
## variables ##
my $mkisofs = '/usr/bin/mkisofs';
my $path    = '';
my $iso     = '';
my $title   = '';
my $cmd;
 
## user options ##
 
GetOptions(
        "path=s"        =>      \$path,
        "iso=s"         =>      \$iso,
        "title=s"       =>      \$title,
);
 
## sanity checks ##
 
if ( ( ! $path ) || ( ! $iso ) || ( ! $title ) ) {
 
    &usage();
}
 
if ( ! -f $mkisofs ) {
 
    print "unable to find mkisofs at $mkisofs\n";
    exit 2;
}
 
## flush the buffer ##
$| = 1;
 
## program start ##
 
$cmd = "$mkisofs -dvd-video -J -L -r -V $title -o $iso $path 2>&1";
#print "running: $cmd\n";
 
open (MKISOFS, "$cmd |"); 
 
while (<MKISOFS>) {
 
    chomp($_);
    printf "\rmkdvdiso: %40s", $_ if /estimate finish/;
}
 
printf "\rmkdvdiso: %40s\n", "completed at";
 
## subroutines ##
 
sub usage() {
 
    print "mkdvdiso - a quick utility for creating dvd iso images\n\n";
    print "usage:\n";
    print "\t-path\tpath and directory containing the VIDEO_TS 
            & AUDIO_TS folders\n";
    print "\t-iso\tpath and name of iso image to be created\n";
    print "\t-title\ttitle for the dvd iso image\n";
 
    exit 1;
}
Tagged with: