Install Jackett Ubuntu command line for additional Torrent

In this tutorial install Jackett via command line Ubuntu . We are going to install the Jackett program. On a Ubuntu system. So you have extra Torrent providers at your disposal. For exapample for Sonnar, CouchPotato or SickRage.

We have to install the necessary software for Jackett.

sudo apt-get install libcurl4-openssl-dev bzip2 -y

We’re going to download Jackett.

jackettver=$(wget -q https://github.com/Jackett/Jackett/releases/latest -O – | grep -E \/tag\/ | awk -F “[>

We’re going to unpack Jackett now.

tar -xvf Jackett*

We make a folder for Jackett.

sudo mkdir /opt/jackett

Now we are going to move the contents of the extracted files. To Jackett’s folder

sudo mv Jackett/* /opt/jackett

We must now set the permissions folder correctly to the Jackket folder.

sudo chown -R username:username /opt/jackett

Now we are testing whether Jackett starts.

mono /opt/jackett/JackettConsole.exe

If Jackett, is started at “http://your-ip-address: 9117”. Then you need Jackett. To close again with CTRL + C.

Jackett auto start Ubuntu

We are now going to make a startup script for Jackett.

sudo nano /etc/init.d/jackett

Paste the following script here. Beware! Customize the user name. To your own.

#location where the ap is,
APP_PATH=/opt/jackett

# User
RUN_AS=username

# Path to Mono bin
DAEMON=$(which mono)

# Location where the PID is
PID_FILE=/var/run/jackett/jackett.pid
PID_PATH=$(dirname $PID_FILE)

# script name
NAME=jackett

# app name
DESC=Jackett

# opstart
EXENAME=”JackettConsole.exe”
DAEMON_OPTS=” “$EXENAME

JACKETT_PID=`ps auxf | grep $EXENAME | grep -v grep | awk ‘{print $2}’`

test -x $DAEMON || exit 0

set -e

#Look for PID and create if doesn’t exist
if [ ! -d $PID_PATH ]; then
mkdir -p $PID_PATH
chown $RUN_AS $PID_PATH
fi

if [ ! -d $DATA_DIR ]; then
mkdir -p $DATA_DIR
chown $RUN_AS $DATA_DIR
fi

if [ -e $PID_FILE ]; then
PID=`cat $PID_FILE`
if ! kill -0 $PID > /dev/null 2>&1; then
echo “Removing stale $PID_FILE”
rm $PID_FILE
fi
fi

echo $JACKETT_PID > $PID_FILE

case “$1” in
start)
if [ -z “${JACKETT_PID}” ]; then
echo “Starting $DESC”
rm -rf $PID_PATH || return 1
install -d –mode=0755 -o $RUN_AS $PID_PATH || return 1
start-stop-daemon -d $APP_PATH -c $RUN_AS –start –background –pidfile $PID_FILE –exec $DAEMON — $DAEMON_OPTS
else
echo “Jackett already running.”
fi
;;
stop)
echo “Stopping $DESC”
echo $JACKETT_PID > $PID_FILE
start-stop-daemon –stop –pidfile $PID_FILE –retry 15
;;

restart|force-reload)
echo “Restarting $DESC”
start-stop-daemon –stop –pidfile $PID_FILE –retry 15
start-stop-daemon -d $APP_PATH -c $RUN_AS –start –background –pidfile $PID_FILE –exec $DAEMON — $DAEMON_OPTS
;;
status)
# Use LSB function library if it exists
if [ -f /lib/lsb/init-functions ]; then
. /lib/lsb/init-functions
if [ -e $PID_FILE ]; then
status_of_proc -p $PID_FILE “$DAEMON” “$NAME” && exit 0 || exit $?
else
log_daemon_msg “$NAME is not running”
exit 3
fi

else
# Use Basic Functions
if [ -e $PID_FILE ]; then
PID=`cat $PID_FILE`
if kill -0 $PID > /dev/null 2>&1; then
echo ” * $NAME is running”
exit 0
fi
else
echo ” * $NAME is not running”
exit 3
fi
fi
;;
*)
N=/etc/init.d/$NAME
echo “Usage: $N {start|stop|restart|force-reload|status}” >&2
exit 1
;;
esac

exit 0

Make the script executable.

sudo chmod +x /etc/init.d/jackett

Now update the Ubuntu boot.

sudo update-rc.d jackett defaults

Now we can start Jackett.

sudo service jackett start

Now we have to make a startup for Jackett.

sudo nano /etc/init/jackett.conf

Copy and paste the below.

#startups script

env DIR=/opt/jackett
setuid user
setgid nogroup

start on runlevel [2345]

stop on runlevel [016]

exec mono $DIR/JackettConsole.exe

You are now done with the installation of Jackett.

Be the first to comment

Leave a Reply