-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathget_iplayer
45 lines (39 loc) · 1.16 KB
/
get_iplayer
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
#! /bin/sh
# Author: prupert
# Basis: Parts of the script based on and inspired by work from
# daemox (ainer.org) tret (sabnzbd.org), beckstown (xbmc.org),
# and midgetspy (sickbeard.com).
# Fixes: Alek (ainer.org), James (ainer.org), Tophicles (ainer.org),
# croontje (sickbeard.com)
# Contact: http://www.prupert.co.uk
# Version: 0.1
### BEGIN INIT INFO
# Provides: get_iplayer
# Required-Start: $all
# Required-Stop: $all
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts and stops get_iplayer web pvr
# Description: get_iplayer web pvr:
### END INIT INFO
#Required -- Must Be Changed!
USER="rupert" #Set Linux Mint, Ubuntu, or Debian user name here.
GETIPLAYER="/home/rupert/src/get_iplayer"
#Script -- No changes needed below.
case "$1" in
start)
#Start get_iplayer web pvr and send all messages to /dev/null.
echo "Starting get_iplayer"
sudo -u $USER -EH nohup perl $GETIPLAYER/get_iplayer.cgi -p 8082 -l 0.0.0.0 -g $GETIPLAYER/get_iplayer > /dev/null 2>&1 &
;;
stop)
#Shutdown get_iplayer
echo "Stopping get_iplayer"
sudo killall get_iplayer.cgi
sleep 6s
;;
*)
echo "Usage: $0 {start|stop}"
exit 1
esac
exit 0