Jail erstellen (mit The Brig)
1 2 3 4 5 6 |
mkdir /mnt/Data/Download mkdir /mnt/Data/Download/Backup mkdir /mnt/Data/Download/Complete mkdir /mnt/Data/Download/Conf mkdir /mnt/Data/Download/Incomplete mkdir /mnt/Data/Download/Scripts |
Downloadpfad im Jail Mount Pfad erstellen
1 |
mkdir /mnt/Storage/Jail/SabNZBd/mnt/Download |
In The Brig Jail SabNZBd unter fstab
1 |
/mnt/Storage/Download /mnt/Storage/Jail/SabNZBd/mnt/Download nullfs rw 0 0 |
Zeige Jails auf und bei SabNZBd Jail anmelden
1 2 |
jls jexec 1 csh |
nun ist man in dieser Jail Shell
1 |
root@SabNZBd:/ # |
Hier werden noch fehlende Pakete nachinstalliert
1 2 3 4 5 6 7 8 9 |
pkg_add -rv python27 py27-sqlite3 pkg_add -rv unzip pkg_add -rv py27-yenc pkg_add -rv py27-cheetah pkg_add -rv py27-openssl pkg_add -rv py27-feedparser pkg_add -rv py27-utils pkg_add -rv unrar pkg_add -rv par2cmdline |
Danach noch SabNZBd
1 2 3 4 5 6 |
cd tmp fetch "http://sourceforge.net/projects/sabnzbdplus/files/sabnzbdplus/0.7.16/SABnzbd-0.7.16-src.tar.gz" tar -xzf SABnzbd-0.7.16-src.tar.gz rm SABnzbd-0.7.16-src.tar.gz mv SABnzbd-0.7.16 SABnzbd mv SABnzbd /usr/local/share/ |
Editieren von SABnzbd.py
1 |
ee /usr/local/share/SABnzbd/SABnzbd.py |
und ändern von
1 |
#!/usr/bin/python to #!/usr/local/bin/python2.7 |
SABnzbd Start / Stop Skript
1 2 |
touch /etc/rc.d/sabnzbd ee /etc/rc.d/sabnzbd |
und unten gezeigten Code einfügen. Bei Bedarf sabnzbd_conf und sabnzbd_PATH an die eigenen Bedürfnisse anpassen.
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 |
#!/bin/sh # # PROVIDE: sabnzbd # REQUIRE: NETWORKING DAEMON # KEYWORD: shutdown # # Add the following lines to /etc/rc.conf.local or /etc/rc.conf # to enable this service: # #sabnzbd_enable="YES" # # It is recommended not to run SABnzbd as root. Add the following # lines to /etc/rc.conf.local or /etc/rc.conf to run the daemon # with the credentials of user 'john' # user 'john' sabnzbd_enable=${sabnzbd_enable-"NO"} sabnzbd_user=root sabnzbd_PATH="/usr/local/share/SABnzbd/SABnzbd.py" sabnzbd_conf="/mnt/Download/Conf/sabnzbd.ini" sabnzbd_IP="" sabnzbd_PORT="8085" #sabnzbd_pass="" #sabnzbd_APIKEY="" . /etc/rc.subr name=sabnzbd rcvar=`set_rcvar` start_cmd=sabnzbd_start stop_cmd=sabnzbd_stop sabnzbd_start() { PATH=$PATH:/usr/local/bin:/usr/local/sbin; export PATH checkyesno sabnzbd_enable && su ${sabnzbd_user} -c "$sabnzbd_PATH --daemon -d -f $sabnzbd_conf" -s $sabnzbd_IP:$sabnzbd_PORT } sabnzbd_stop() { sabnzbd_pid=`ps -U ${sabnzbd_user} | grep "python.*SABnzbd.py.*--daemon" | grep -v 'grep' | awk '{print $1}'` checkyesno sabnzbd_enable && if [ -n "${sabnzbd_pid}" ]; then kill ${sabnzbd_pid}; fi } load_rc_config ${name} run_rc_command "$1" |
Diese ausführbar machen
1 |
chmod 755 /etc/rc.d/sabnzbd |
Nun kann der Dienst gestartet und gestoppt werden.
1 2 |
/etc/rc.d/sabnzbd start /etc/rc.d/sabnzbd stop |
Für Autostart, foglende Datei ändern /etc/rc.conf
1 |
sabnzbd_enable="YES" |
Update funktioniert folgendermaßen
1 2 3 4 5 6 7 8 |
/etc/rc.d/sabnzbd stop cd tmp rm -rf /usr/local/share/Sabnzbd fetch "http://sourceforge.net/projects/sabnzbdplus/files/sabnzbdplus/new Version" tar -xzf new Version.tar.gz rm new Version.tar.gz mv new Version Sabnzbd mv Sabnzbd /usr/local/share/ |
Wie weiter oben aufgeführt, die SABnzbd.py anpassen.
Anschließend kann der Wizard im Browser gestartet werden durch den Aufruf
1 |
http://gewählteIP:8080 |
und danach SABnzbd mit
1 2 3 |
http://gewählteIP:8080/sabnzbd/ oder http://SABnzbd.local:8080/sabnzbd/ |