Certificate Update Script for Sabnzbd and Sickbeard

The discussion lounge for third-party packages.
Forum rules
We've moved! Head over to Synology Community (community.synology.com) to meet up with our team and other Synology enthusiasts!
gator
Student
Student
Posts: 79
Joined: Sun Oct 27, 2013 3:06 am

Certificate Update Script for Sabnzbd and Sickbeard

Unread post by 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

Locked

Return to “Third-party Packages”