mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +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
|
. /etc/profile
|
||||||
|
|
||||||
|
LOCKDIR="/var/lock/"
|
||||||
|
LOCKFILE="tvheadend"
|
||||||
|
|
||||||
case "$1" in
|
case "$1" in
|
||||||
hibernate|suspend)
|
hibernate|suspend)
|
||||||
if [ $(pidof tvheadend) ];then
|
if [ $(pidof tvheadend) ];then
|
||||||
progress "Shutting down HTS TVHeadend for suspending..."
|
progress "Shutting down HTS TVHeadend for suspending..."
|
||||||
|
mkdir -p "$LOCKDIR"
|
||||||
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
killall tvheadend
|
killall tvheadend
|
||||||
fi
|
fi
|
||||||
;;
|
;;
|
||||||
|
|
||||||
thaw|resume)
|
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
|
*) exit $NA
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
@ -1,6 +1,6 @@
|
|||||||
################################################################################
|
################################################################################
|
||||||
# Copyright (C) 2009-2010 OpenELEC.tv
|
# This file is part of OpenELEC - http://www.openelec.tv
|
||||||
# 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
|
# 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
|
# it under the terms of the GNU General Public License as published by
|
||||||
@ -18,19 +18,13 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# start tvheadend tv server
|
# only does something with adding "dvb" subsystem devices.
|
||||||
#
|
ACTION!="add|remove", GOTO="end"
|
||||||
# runlevels: openelec, textmode
|
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"
|
||||||
|
|
||||||
(
|
LABEL="end"
|
||||||
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
|
|
||||||
)&
|
|
Loading…
x
Reference in New Issue
Block a user