Certificate Update Script for Sabnzbd and Sickbeard

The discussion lounge for third-party packages.
Forum rules
1) This is a user forum for Synology users to share experience/help out each other: if you need direct assistance from the Synology technical support team, please use the following form:

https://account.synology.com/support/support_form.php?lang=enu



2) To avoid putting users' DiskStation at risk, please don't paste links to any patches provided by our Support team as we will systematically remove them. Our Support team will provide the correct patch for your DiskStation model.
gator
Student
Student
Posts: 76
Joined: Sun Oct 27, 2013 3:06 am

Certificate Update Script for Sabnzbd and Sickbeard

Postby gator » Wed Jan 03, 2018 1:29 am

Here is the script I use to update the certificates for sickbeard and sabnzbd since I have to do this every 3 months. Be sure to set CERT, KEY, and CA.

Code: Select all

#!/bin/bash

if [ "$(id)" != "uid=0(root) gid=0(root) groups=0(root),2(daemon),19(log)" ]; then
   echo "You must be root so you need to su"
   exit
fi


# Put your .cer .key and ca.cer in the following including the full path
CERT=""
KEY=""
CA=""

SABNZBD="/usr/local/sabnzbd/var/admin"
SICKBEARD="/usr/local/sickbeard/var"


echo -n "CERT: "
ls $CERT
echo -n "KEY: "
ls $KEY
echo -n "CA: "
ls $CA

echo
echo "SABNZBD"
ls -l $SABNZBD/server.crt
ls -l $SABNZBD/server.key
ls -l $SABNZBD/server-ca.crt
cp $CERT $SABNZBD/server.crt    ; chmod 600 $SABNZBD/server.crt    ; chown sabnzbd:root $SABNZBD/server.crt
cp $KEY  $SABNZBD/server.key    ; chmod 600 $SABNZBD/server.key    ; chown sabnzbd:root $SABNZBD/server.key
cp $CA   $SABNZBD/server-ca.crt ; chmod 600 $SABNZBD/server-ca.crt ; chown sabnzbd:root $SABNZBD/server-ca.crt

echo
echo "SICKBEARD"
ls -l $SICKBEARD/server.crt
ls -l $SICKBEARD/server.key
ls -l $SICKBEARD/server-ca.crt
cp $CERT $SICKBEARD/server.crt    ; chmod 600 $SICKBEARD/server.crt    ; chown sickbeard:root $SICKBEARD/server.crt
cp $KEY  $SICKBEARD/server.key    ; chmod 600 $SICKBEARD/server.key    ; chown sickbeard:root $SICKBEARD/server.key
cp $CA   $SICKBEARD/server-ca.crt ; chmod 600 $SICKBEARD/server-ca.crt ; chown sickbeard:root $SICKBEARD/server-ca.crt

echo Be sure to restart sabnzbd and sickbeard to load the new certificates

Return to “Third-party Packages”

Who is online

Users browsing this forum: No registered users and 3 guests