mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-08-01 15:07:49 +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
|
2.0.6
|
||||||
- enable unloading/loading dvb modules on suspend/resume
|
- enable unloading/loading dvb modules on suspend/resume
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
PKG_NAME="vdr-addon"
|
PKG_NAME="vdr-addon"
|
||||||
PKG_VERSION="2.0"
|
PKG_VERSION="2.0"
|
||||||
PKG_REV="6"
|
PKG_REV="7"
|
||||||
PKG_ARCH="any"
|
PKG_ARCH="any"
|
||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="http://www.openelec.tv"
|
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 os
|
||||||
import sys
|
import sys
|
||||||
import xbmcaddon
|
import xbmcaddon
|
||||||
|
import time
|
||||||
|
import subprocess
|
||||||
|
|
||||||
__scriptname__ = "VDR Service"
|
__scriptname__ = "VDR Service"
|
||||||
__author__ = "OpenELEC"
|
__author__ = "OpenELEC"
|
||||||
__url__ = "http://www.openelec.tv"
|
__url__ = "http://www.openelec.tv"
|
||||||
__settings__ = xbmcaddon.Addon(id='service.multimedia.vdr-addon')
|
__settings__ = xbmcaddon.Addon(id='service.multimedia.vdr-addon')
|
||||||
__cwd__ = __settings__.getAddonInfo('path')
|
__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
|
#!/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
|
. /etc/profile
|
||||||
|
|
||||||
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.multimedia.vdr-addon"
|
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
|
if [ ! "$REMOVE_MODULES" == "" ] ; then
|
||||||
case "$1" in
|
case "$1" in
|
||||||
hibernate|suspend)
|
hibernate|suspend)
|
||||||
killall -9 vdr.bin
|
vdr.stop
|
||||||
# xbmc-send -a "Notification(suspend,unloading modules...)"
|
|
||||||
for module in $REMOVE_MODULES ; do
|
for module in $REMOVE_MODULES ; do
|
||||||
rmmod -w $module
|
rmmod -w $module
|
||||||
done
|
done
|
||||||
;;
|
;;
|
||||||
thaw|resume)
|
thaw|resume)
|
||||||
# xbmc-send -a "Notification(resume,loading modules...)"
|
|
||||||
for module in $REMOVE_MODULES ; do
|
for module in $REMOVE_MODULES ; do
|
||||||
modprobe $module
|
modprobe $module
|
||||||
done
|
done
|
||||||
# xbmc-send -a "Notification(resume,starting vdr service...)"
|
xbmc-send --host=127.0.0.1 -a "XBMC.RunScript(service.multimedia.vdr-addon)" &
|
||||||
vdr.service
|
|
||||||
;;
|
;;
|
||||||
*) exit $NA
|
*) exit $NA
|
||||||
;;
|
;;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user