Install Plex Requests.Net Ubuntu 14.x

plex-requests.net-logoInstall Plex Requests.Net on Ubuntu 14.x so your family and friends can easily request media for your Plex Media Server. Plex Requests.Net is the .NET port of  the node.js-based Plex Requests.  Plex Requests.Net works with automation software to grab new content requests that your Plex users may have. It is compatible with CouchPotato, Sonarr and SickRage for getting content automatically from usenet or torrents. This tutorial was tested on Ubuntu 14.x and includes an init.d script to autostart Plex Requests.Net on boot.

Usenet Provider
Backbone
Retention
Speed
Connections
VPN
Monthly
Annual
UsenetServer
UsenetServer
2265
Unlimited
20
Yes
$10
$95.40
Usenetlink
Cloudgate
2000
100 Mbit
30
No
$15
$140
Astraweb
Astraweb
2264
Unlimited
20
No
$7.50
$96.00
UsenetBucket
XS News
1100
40 Mbit
25
No
€4.95
€60.00
Frugal
Blocknews
600
Unlimited
60
No
$4.99
$50.00

Here is a screenshot of the Plex Requests.Net web interface

plex-requests.net-welcome-screen-min

Install Plex Requests.Net Ubuntu 14.x

PlexRequests requires mono which is the .NET framework ported to Linux systems.

Install Mono

Install Mono using the Xamarin repository, it’s quite a large package so it will take some time

sudo apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys 3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
echo "deb http://download.mono-project.com/repo/debian wheezy main" | sudo tee /etc/apt/sources.list.d/mono-xamarin.list
sudo apt-get update
sudo apt-get install mono-complete unzip -y

Install PlexRequests.Net

Create the PlexRequests directory and make your regular user the owner – replace htpcguides with your username

sudo mkdir /opt/plexrequests.net
sudo chown -R htpcguides:htpcguides /opt/plexrequests.net

Get latest PlexRequests download link from here, use the PlexRequests.zip link and replace the red text with it below.

cd /tmp
wget https://github.com/tidusjar/PlexRequests.Net/releases/download/v1.7.5/PlexRequests.zip

Unpack the zip and move it into the PlexRequests folder

unzip PlexRequests.zip
rm PlexRequests.zip
cd /tmp/Release
mv * /opt/plexrequests.net/

Enter the PlexRequests.net folder and execute PlexRequests

cd /opt/plexrequests.net
mono PlexRequests.exe

You should see this output which indicates which port PlexRequests.NET is running on.

The default PlexRequests.NET port is 3579

Starting Up! Please wait, this can usually take a few seconds.
Version: 1.7.5
Location of the database: /opt/plexrequests.net/PlexRequests.sqlite
no configuration section <common/logging> found - suppressing logging output
Plex Requests is running on the following: http://+:3579/
All setup, Plex Requests is now ready!

Now we can start Plex Requests.NET on boot.

Use Ctrl+C to kill the Plex Requests.Net process we started with mono PlexRequests.exe

Make PlexRequests.NET Start on Boot

Create the Plex Requests.Net init.d script

sudo nano /etc/init.d/plexrequests.net

Paste the Plex Requests.NET init.d script, replace htpcguides below with your regular user name

#!/bin/sh
### BEGIN INIT INFO
# Provides:          PlexRequests.net
# Required-Start:    $local_fs $remote_fs $network
# Required-Stop:     $local_fs $remote_fs $network
# Default-Start:     2 3 4 5
# Default-Stop:      0 1 6
# Short-Description: PlexRequests.net
# Description:       PlexRequests.net
### END INIT INFO
 
 
# Documentation available at
# http://refspecs.linuxfoundation.org/LSB_3.1.0/LSB-Core-generic/LSB-Core-generic/iniscrptfunc.html
# Debian provides some extra functions though
. /lib/lsb/init-functions
 
DAEMON_NAME="PlexRequests.net"
DAEMON_USER=htpcguides
DAEMON_PATH="/usr/bin/mono"
DAEMON_OPTS="PlexRequests.exe"
DAEMON_PWD="/opt/plexrequests.net/"
DAEMON_DESC=$(get_lsb_header_val $0 "Short-Description")
DAEMON_PID="/var/run/${DAEMON_NAME}.pid"
DAEMON_NICE=0
DAEMON_LOG='/var/log/plexrequests.net.log'
 
[ -r "/etc/default/${DAEMON_NAME}" ] && . "/etc/default/${DAEMON_NAME}"
 
do_start() {
  local result
 
	pidofproc -p "${DAEMON_PID}" "${DAEMON_PATH}" > /dev/null
	if [ $? -eq 0 ]; then
		log_warning_msg "${DAEMON_NAME} is already started"
		result=0
	else
		log_daemon_msg "Starting ${DAEMON_DESC}" "${DAEMON_NAME}"
		touch "${DAEMON_LOG}"
		chown $DAEMON_USER "${DAEMON_LOG}"
		chmod u+rw "${DAEMON_LOG}"
		if [ -z "${DAEMON_USER}" ]; then
			start-stop-daemon --start --quiet --oknodo --background \
				--nicelevel $DAEMON_NICE \
				--chdir "${DAEMON_PWD}" \
				--pidfile "${DAEMON_PID}" --make-pidfile \
				--exec "${DAEMON_PATH}" -- $DAEMON_OPTS
			result=$?
		else
			start-stop-daemon --start --quiet --oknodo --background \
				--nicelevel $DAEMON_NICE \
				--chdir "${DAEMON_PWD}" \
				--pidfile "${DAEMON_PID}" --make-pidfile \
				--chuid "${DAEMON_USER}" \
				--exec "${DAEMON_PATH}" -- $DAEMON_OPTS
			result=$?
		fi
		log_end_msg $result
	fi
	return $result
}
 
do_stop() {
	local result
 
	pidofproc -p "${DAEMON_PID}" "${DAEMON_PATH}" > /dev/null
	if [ $? -ne 0 ]; then
		log_warning_msg "${DAEMON_NAME} is not started"
		result=0
	else
		log_daemon_msg "Stopping ${DAEMON_DESC}" "${DAEMON_NAME}"
		killproc -p "${DAEMON_PID}" "${DAEMON_PATH}"
		result=$?
		log_end_msg $result
		rm "${DAEMON_PID}"
	fi
	return $result
}
 
do_restart() {
	local result
	do_stop
	result=$?
	if [ $result = 0 ]; then
		do_start
		result=$?
	fi
	return $result
}
 
do_status() {
	local result
	status_of_proc -p "${DAEMON_PID}" "${DAEMON_PATH}" "${DAEMON_NAME}"
	result=$?
	return $result
}
 
do_usage() {
	echo $"Usage: $0 {start | stop | restart | status}"
	exit 1
}
 
case "$1" in
start)   do_start;   exit $? ;;
stop)    do_stop;    exit $? ;;
restart) do_restart; exit $? ;;
status)  do_status;  exit $? ;;
*)       do_usage;   exit  1 ;;
esac

Make the PlexRequests init.d script executable

sudo chmod +x /etc/init.d/plexrequests.net

Enable the PlexRequests init.d script on boot

sudo update-rc.d plexrequests.net defaults

Now you can start the PlexReqeuests.NET service

sudo service plexrequests.net start