mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-31 14:37:59 +00:00
Merge pull request #236 from stefansaraev/vdr-sleep-update
vdr-addon: add possibilty to start / stop addon from addon manager with enable / disable
This commit is contained in:
commit
3c755f1c0e
@ -1,3 +1,6 @@
|
||||
2.0.7
|
||||
- add possibilty to start / stop addon from addon manager with enable / disable
|
||||
|
||||
2.0.6
|
||||
- enable unloading/loading dvb modules on suspend/resume
|
||||
|
||||
|
@ -21,7 +21,7 @@
|
||||
|
||||
PKG_NAME="vdr-addon"
|
||||
PKG_VERSION="2.0"
|
||||
PKG_REV="6"
|
||||
PKG_REV="7"
|
||||
PKG_ARCH="any"
|
||||
PKG_LICENSE="GPL"
|
||||
PKG_SITE="http://www.openelec.tv"
|
||||
|
28
packages/addons/service/multimedia/vdr-addon/source/bin/vdr.stop
Executable file
28
packages/addons/service/multimedia/vdr-addon/source/bin/vdr.stop
Executable file
@ -0,0 +1,28 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. /etc/profile
|
||||
|
||||
if [ $(pidof vdr.bin) ];then
|
||||
killall vdr.bin
|
||||
fi
|
||||
|
@ -21,12 +21,23 @@
|
||||
import os
|
||||
import sys
|
||||
import xbmcaddon
|
||||
import time
|
||||
import subprocess
|
||||
|
||||
__scriptname__ = "VDR Service"
|
||||
__author__ = "OpenELEC"
|
||||
__url__ = "http://www.openelec.tv"
|
||||
__settings__ = xbmcaddon.Addon(id='service.multimedia.vdr-addon')
|
||||
__cwd__ = __settings__.getAddonInfo('path')
|
||||
__path__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "vdr.service") )
|
||||
__start__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "vdr.start") )
|
||||
__stop__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "vdr.stop") )
|
||||
|
||||
os.system(__path__)
|
||||
#make binary files executable in adson bin folder
|
||||
subprocess.Popen("chmod -R +x " + __cwd__ + "/bin/*" , shell=True, close_fds=True)
|
||||
|
||||
subprocess.Popen(__start__, shell=True, close_fds=True)
|
||||
|
||||
while (not xbmc.abortRequested):
|
||||
time.sleep(0.250)
|
||||
|
||||
subprocess.Popen(__stop__, shell=True, close_fds=True)
|
||||
|
@ -1,5 +1,25 @@
|
||||
#!/bin/sh
|
||||
|
||||
################################################################################
|
||||
# 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
|
||||
# the Free Software Foundation; either version 2, or (at your option)
|
||||
# any later version.
|
||||
#
|
||||
# This Program is distributed in the hope that it will be useful,
|
||||
# but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
# GNU General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU General Public License
|
||||
# along with OpenELEC.tv; see the file COPYING. If not, write to
|
||||
# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
|
||||
# http://www.gnu.org/copyleft/gpl.html
|
||||
################################################################################
|
||||
|
||||
. /etc/profile
|
||||
|
||||
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.vdr-addon"
|
||||
@ -11,19 +31,16 @@ if [ -f "$ADDON_CONFIG_DIR/vdr-sleep.conf" ]; then
|
||||
if [ ! "$REMOVE_MODULES" == "" ] ; then
|
||||
case "$1" in
|
||||
hibernate|suspend)
|
||||
killall -9 vdr.bin
|
||||
# xbmc-send -a "Notification(suspend,unloading modules...)"
|
||||
vdr.stop
|
||||
for module in $REMOVE_MODULES ; do
|
||||
rmmod -w $module
|
||||
done
|
||||
;;
|
||||
thaw|resume)
|
||||
# xbmc-send -a "Notification(resume,loading modules...)"
|
||||
for module in $REMOVE_MODULES ; do
|
||||
modprobe $module
|
||||
done
|
||||
# xbmc-send -a "Notification(resume,starting vdr service...)"
|
||||
vdr.service
|
||||
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.vdr-addon)" &
|
||||
;;
|
||||
*) exit $NA
|
||||
;;
|
||||
|
Loading…
x
Reference in New Issue
Block a user