mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 06:06:43 +00:00
hts-tvheadend: add udev rule to start tvheadend, rework and rename suspend script
Signed-off-by: Stephan Raue <stephan@openelec.tv>
This commit is contained in:
parent
ee3d2b0e3f
commit
3e913677f5
@ -22,16 +22,27 @@
|
||||
|
||||
. /etc/profile
|
||||
|
||||
LOCKDIR="/var/lock/"
|
||||
LOCKFILE="tvheadend"
|
||||
|
||||
case "$1" in
|
||||
hibernate|suspend)
|
||||
if [ $(pidof tvheadend) ];then
|
||||
progress "Shutting down HTS TVHeadend for suspending..."
|
||||
mkdir -p "$LOCKDIR"
|
||||
touch "$LOCKDIR/$LOCKFILE"
|
||||
killall tvheadend
|
||||
fi
|
||||
;;
|
||||
|
||||
thaw|resume)
|
||||
. /etc/init.d/81_tvheadend
|
||||
if [ -f "$LOCKDIR/$LOCKFILE" ];then
|
||||
progress "Restarting HTS TVHeadend for wakeup..."
|
||||
tvheadend -C -s -f -u root -g root
|
||||
rm -rf "$LOCKDIR/$LOCKFILE"
|
||||
fi
|
||||
;;
|
||||
|
||||
*) exit $NA
|
||||
;;
|
||||
esac
|
@ -1,6 +1,6 @@
|
||||
################################################################################
|
||||
# Copyright (C) 2009-2010 OpenELEC.tv
|
||||
# http://www.openelec.tv
|
||||
# This file is part of OpenELEC - http://www.openelec.tv
|
||||
# Copyright (C) 2009-2011 Stephan Raue (stephan@openelec.tv)
|
||||
#
|
||||
# This Program is free software; you can redistribute it and/or modify
|
||||
# it under the terms of the GNU General Public License as published by
|
||||
@ -18,19 +18,13 @@
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
# start tvheadend tv server
|
||||
#
|
||||
# runlevels: openelec, textmode
|
||||
# only does something with adding "dvb" subsystem devices.
|
||||
ACTION!="add|remove", GOTO="end"
|
||||
SUBSYSTEM!="dvb", GOTO="end"
|
||||
ENV{DVB_DEVICE_TYPE}!="frontend", GOTO="end"
|
||||
|
||||
OPENELEC_SETTINGS="$HOME/.xbmc/userdata/addon_data/os.openelec.settings/settings.xml"
|
||||
# Start TVHeadend if dvb frontend is starting
|
||||
ACTION=="add", RUN+="/usr/bin/tvheadend -C -s -f -u root -g root"
|
||||
ACTION=="remove", RUN+="/usr/bin/killall tvheadend"
|
||||
|
||||
(
|
||||
if [ -f "$OPENELEC_SETTINGS" ]; then
|
||||
TVHEADEND_START=`grep TVHEADEND_START $OPENELEC_SETTINGS | awk '{print $3 }' | sed -e "s,value=,," -e "s,\",,g"`
|
||||
|
||||
if [ "$TVHEADEND_START" = "true" ]; then
|
||||
progress "starting TV Server"
|
||||
tvheadend -C -s -f -u root -g root
|
||||
fi
|
||||
fi
|
||||
)&
|
||||
LABEL="end"
|
Loading…
x
Reference in New Issue
Block a user