vdr-addon: add possibilty to start / stop addon from addon manager with enable / disable

This commit is contained in:
Stefan Saraev 2012-02-26 15:04:26 +02:00
parent 1adbd9af38
commit 6f06800dde
6 changed files with 47 additions and 5 deletions

View File

@ -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

View File

@ -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"

View 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

View File

@ -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)

View File

@ -31,7 +31,7 @@ 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...)" # 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
@ -43,7 +43,7 @@ if [ -f "$ADDON_CONFIG_DIR/vdr-sleep.conf" ]; then
modprobe $module modprobe $module
done done
# xbmc-send -a "Notification(resume,starting vdr service...)" # xbmc-send -a "Notification(resume,starting vdr service...)"
vdr.service vdr.start
;; ;;
*) exit $NA *) exit $NA
;; ;;