summaryrefslogtreecommitdiffstats
path: root/multimedia
diff options
context:
space:
mode:
author Jeremy Hansen <jebrhansen+github@gmail.com>2024-03-04 20:43:21 -0800
committer Willy Sudiarto Raharjo <willysr@slackbuilds.org>2024-03-05 12:44:53 +0700
commitaf6e49416babe4bff486e650022bfeda7a7e465c (patch)
treee661dcba3d704c03b4590a0dbdd3563b01c5afe4 /multimedia
parentd698d0df2a844b461558b7d7d4c019627eb4fa84 (diff)
downloadslackbuilds-af6e49416babe4bff486e650022bfeda7a7e465c.tar.gz
slackbuilds-af6e49416babe4bff486e650022bfeda7a7e465c.tar.xz
multimedia/sickchill: Version bump to 2024.3.1
Signed-off-by: Willy Sudiarto Raharjo <willysr@slackbuilds.org>
Diffstat (limited to 'multimedia')
-rw-r--r--multimedia/sickchill/rc.sickchill129
-rw-r--r--multimedia/sickchill/sickchill.SlackBuild52
-rw-r--r--multimedia/sickchill/sickchill.info6
3 files changed, 126 insertions, 61 deletions
diff --git a/multimedia/sickchill/rc.sickchill b/multimedia/sickchill/rc.sickchill
index bb89629a9c..28fa0050d0 100644
--- a/multimedia/sickchill/rc.sickchill
+++ b/multimedia/sickchill/rc.sickchill
@@ -1,55 +1,92 @@
#!/bin/bash
+
# Start/stop/restart sickchill.
-# rc.sickrage created by Jeremy Hansen for Slackware in 2016
-# rc.sickchill was updated by Jeremy Hansen for Slackware in 2023
+# Originally created for sickrage in 2016
+# Updated to sickchill in 2023
+
+# Copyright 2016-2024 Jeremy Hansen <jebrhansen+SBo@gmail.com>
+# All rights reserved.
+#
+# Redistribution and use of this script, with or without modification, is
+# permitted provided that the following conditions are met:
+#
+# 1. Redistributions of this script must retain the above copyright
+# notice, this list of conditions and the following disclaimer.
+#
+# THIS SOFTWARE IS PROVIDED BY THE AUTHOR "AS IS" AND ANY EXPRESS OR IMPLIED
+# WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+# MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO
+# EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+# SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+# PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
+# OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
+# WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
+# OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+# ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
# Set program name in case you want to run sick{beard|rage|gear|etc}
PROG=${PROG:-sickchill}
+# If you want to have multiple instances of sickchill running, set
+# the suffix here.
+SUFFIX=
+
+# Set the full program name for folders
+if [ -n "$SUFFIX" ]; then
+ FULLPROG="$PROG-$SUFFIX"
+# Just use $PROG if there isn't a suffix set
+else
+ FULLPROG="$PROG"
+fi
+
# Source SickRage configuration
-if [ -f /etc/"$PROG".conf ]; then
- . /etc/"$PROG".conf
+if [ -f /etc/"$FULLPROG".conf ]; then
+ . /etc/"$FULLPROG".conf
fi
# Ensure all required variables are set in conf file
-# Edit conf file in /etc/sickchill.conf for any changes
+# Edit conf file in /etc/$PROG-$SUFFIX.conf for any changes
+MISSING=0
for var in USERNAME HOMEDIR DATADIR PIDFILE PORT; do
if [ -z "${!var}" ]; then
- echo "/etc/$PROG.conf is missing some or all required variables ($var)."
- echo "Please check the file and try again."
- exit 1
+ ((MISSING++))
+ VAR="$var $VAR"
fi
done
+if [ $MISSING -gt 0 ]; then
+ echo "/etc/$FULLPROG.conf is missing some or all required variables ($VAR)."
+ echo "Please check the file and try again."
+fi
# Check if the program is running and pid file exists
-check() {
+check()
+{
if pgrep "$PROG" > /dev/null; then
- if [ -e "$PIDFILE" ] && ! pgrep -F "$PIDFILE" > /dev/null; then
- STATUS=broken
- echo "WARNING: $PROG is running, but its PID does not match the one in $PIDFILE."
- elif [ ! -e "$PIDFILE" ]; then
- STATUS=broken
- echo "WARNING: $PROG is running, but $PIDFILE does not exist."
- echo "Maybe you ran $PROG from the commandline rather than rc.sickchill?"
- else
+ # Check if the pidfile matches the running pid
+ if [ -e "$PIDFILE" ] && pgrep -f "$PIDFILE" > /dev/null; then
STATUS=running
- fi
- else
- if [ -e "$PIDFILE" ]; then
- STATUS=broken
- echo "WARNING: $PROG is not running but $PIDFILE exists."
else
- STATUS=stopped
+ # Check if the program is running without the pid file matching
+ if pgrep -f "$FULLPROG.*$PORT" > /dev/null; then
+ STATUS=broken
+ echo "WARNING: $FULLPROG is running without the correct pid file."
+ echo "Did you start it without using the rc.$FULLPROG?"
+ else
+ STATUS=stopped
+ fi
fi
+ else
+ STATUS=stopped
fi
}
-status() {
+status()
+{
if [ $STATUS == "running" ]; then
- echo "$PROG currently running."
+ echo "$FULLPROG currently running."
elif [ $STATUS == "stopped" ]; then
- echo "$PROG not running."
+ echo "$FULLPROG not running."
elif [ $STATUS == "broken" ]; then
echo "Please fix the issue before attempting to run $(basename "$0") again."
else
@@ -57,21 +94,23 @@ status() {
fi
}
-start() {
- if [ $STATUS == "running" ]; then
- echo "$PROG already running or not shut down properly."
- else
- echo -n "Starting $PROG: "
- if su "$USERNAME" -s /bin/sh -c "/usr/bin/sickchill --daemon --pidfile=${PIDFILE} --datadir=${DATADIR} --port=${PORT} &> /dev/null"; then
+start()
+{
+ if [ $STATUS == "stopped" ]; then
+ if su "$USERNAME" -s /bin/sh -c "/usr/bin/${PROG} --daemon --pidfile=${PIDFILE} --datadir=${DATADIR} --port=${PORT} &> /dev/null"; then
echo "Startup Successful"
else
- echo "Startup Failed. Please try running the following to see the errors."
- echo "su $USERNAME -s /bin/sh -c \"/usr/bin/sickchill --daemon --pidfile=${PIDFILE} --datadir=${DATADIR} --port=${PORT}\""
+ su "$USERNAME" -s /bin/sh -c "/usr/bin/${PROG} --daemon --pidfile=${PIDFILE} --datadir=${DATADIR} --port=${PORT}"
+ echo "Startup Failed. The following command is what produced the failure:"
+ echo "su $USERNAME -s /bin/sh -c \"/usr/bin/${PROG} --daemon --pidfile=${PIDFILE} --datadir=${DATADIR} --port=${PORT}\""
fi
+ else
+ status
fi
}
-stop() {
+stop()
+{
if [ $STATUS == "stopped" ]; then
echo "$PROG doesn't seem to be running. Please try running"
echo "$0 start"
@@ -82,14 +121,24 @@ stop() {
echo "Please run as root"
exit 1
fi
- PID=$(cat "$PIDFILE")
echo -n $"Shutting down $PROG: "
- if ! curl -s http://localhost:"$PORT"/home/shutdown/?pid="$PID" | grep -q "shutting down"; then
+ curl -s http://localhost:"$PORT"/home/shutdown/?pid="$(cat "$PIDFILE")" | grep -q "shutting down"
+ # sickchill can take some time to properly shut down.
+ #Give it 10 seconds before forcing it to close.
+ TIMEOUT=10
+ for (( COUNT=0; COUNT <= TIMEOUT; COUNT++ )); do
+ if pgrep -f "$FULLPROG.*$PORT" > /dev/null; then
+ SHUTDOWN=success
+ break
+ fi
+ sleep 1
+ done
+ if [ "$SHUTDOWN" == "success" ]; then
+ echo "Shutdown successful."
+ else
echo "Normal Shutdown Failed - Attempting to kill the process."
sleep 7
- kill -9 "$PID"
- else
- echo "Shutdown Successful"
+ pkill -9 -F "$PIDFILE"
fi
fi
}
diff --git a/multimedia/sickchill/sickchill.SlackBuild b/multimedia/sickchill/sickchill.SlackBuild
index 66998c5490..094cd49c98 100644
--- a/multimedia/sickchill/sickchill.SlackBuild
+++ b/multimedia/sickchill/sickchill.SlackBuild
@@ -24,7 +24,7 @@
cd $(dirname $0) ; CWD=$(pwd)
PRGNAM=sickchill
-VERSION=${VERSION:-2024.2.2}
+VERSION=${VERSION:-2024.3.1}
BUILD=${BUILD:-1}
TAG=${TAG:-_SBo}
PKGTYPE=${PKGTYPE:-tgz}
@@ -37,29 +37,45 @@ if [ -z "$ARCH" ]; then
esac
fi
+if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
+ echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
+ exit 0
+fi
+
SICKUSER=${SICKUSER:-sickchill}
SICKGROUP=${SICKGROUP:-sickchill}
# The user and group accounts need to be created manually.
# For slackbuilds.org, assigned sickchill uid/gid are 377/377
# See http://slackbuilds.org/uid_gid.txt
-if ! grep ^$SICKGROUP: /etc/group 2>&1 > /dev/null; then
- echo " You must have a \"$SICKGROUP\" group to run this script."
- echo " # groupadd -g 377 $SICKGROUP"
- echo " If you previously had sickrage installed, change the group using"
- echo " # groupmod -n sickchill sickrage"
- exit 1
-elif ! grep ^$SICKUSER: /etc/passwd 2>&1 > /dev/null; then
- echo " You must have a \"$SICKUSER\" user to run this script."
- echo " # useradd -u 377 -g $SICKGROUP -d /var/lib/sickchill -s /bin/false $SICKUSER"
- echo " If you previously had sickrage installed, change the user using"
- echo " # usermod -l sickchill -g sickchill -d /var/lib/sickchill sickrage"
- exit 1
-fi
-
-if [ ! -z "${PRINT_PACKAGE_NAME}" ]; then
- echo "$PRGNAM-$VERSION-$ARCH-$BUILD$TAG.$PKGTYPE"
- exit 0
+if ! grep -q ^$SICKGROUP: /etc/group > /dev/null; then
+ # Handle older versions of sickrage
+ if grep -q ^sickrage: /etc/group; then
+ echo " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ echo " You seem to have sickrage previously installed..."
+ echo " If you want to switch to sickchill, change the group using:"
+ echo " # groupmod -n sickchill sickrage"
+ echo " Otherwise..."
+ echo " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ fi
+ echo " You must have a \"$SICKGROUP\" group to run this script."
+ echo " # groupadd -g 377 $SICKGROUP"
+ exit 1
+elif ! grep -q ^$SICKUSER: /etc/passwd ; then
+ # Handle older versions of sickrage
+ if grep -q ^sickrage: /etc/passwd; then
+ echo " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ echo " You seem to have sickrage previously installed..."
+ echo " If you want to switch to sickchill, change the user using:"
+ echo " # groupmod -n sickchill sickrage"
+ echo " Otherwise..."
+ echo " +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
+ fi
+ echo " You must have a \"$SICKUSER\" user to run this script."
+ echo " # useradd -u 377 -g $SICKGROUP -d /var/lib/sickchill -s /bin/false $SICKUSER"
+ echo " If you previously had sickrage installed, change the user using"
+ echo " # usermod -l sickchill -g sickchill -d /var/lib/sickchill sickrage"
+ exit 1
fi
TMP=${TMP:-/tmp/SBo}
diff --git a/multimedia/sickchill/sickchill.info b/multimedia/sickchill/sickchill.info
index f835068004..66d5282dee 100644
--- a/multimedia/sickchill/sickchill.info
+++ b/multimedia/sickchill/sickchill.info
@@ -1,8 +1,8 @@
PRGNAM="sickchill"
-VERSION="2024.2.2"
+VERSION="2024.3.1"
HOMEPAGE="https://sickchill.github.io/"
-DOWNLOAD="https://github.com/SickChill/sickchill/archive/refs/tags/2024.2.2/sickchill-2024.2.2.tar.gz"
-MD5SUM="7dc155800ee0051b49312af54ff31a69"
+DOWNLOAD="https://github.com/SickChill/sickchill/archive/refs/tags/2024.3.1/sickchill-2024.3.1.tar.gz"
+MD5SUM="ed4ac0ad41142a5eef0443cb008d92a7"
DOWNLOAD_x86_64=""
MD5SUM_x86_64=""
REQUIRES="python3-PyGithub python3-ifaddr python3-cacheyou python3-tornado Unidecode python-gntp python3-kodipydent python3-cinemagoer python3-validators python-jsonrpclib python3-markdown2 subliminal twitter requests-oauthlib configobj imagesize python3-tvdbsimple python3-fanart python3-tmdbsimple python3-slugify send2trash pyOpenSSL pymediainfo python3-putio.py python3-pynma python3-deluge-client python3-qbittorrent-api python3-new-rtorrent python3-timeago python3-profilehooks"