mirror of
https://github.com/LibreELEC/LibreELEC.tv.git
synced 2025-07-30 22:26:42 +00:00
Merge branch 'oscam-service-fix' of git://github.com/stefansaraev/OpenELEC.tv
This commit is contained in:
commit
b847cfb866
@ -1,3 +1,6 @@
|
|||||||
|
2.0.2
|
||||||
|
- add possibilty to start / stop addon from addon manager with enable / disable
|
||||||
|
|
||||||
2.0.1
|
2.0.1
|
||||||
- enable libusb support for smartcard support
|
- enable libusb support for smartcard support
|
||||||
|
|
||||||
|
@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
PKG_NAME="oscam"
|
PKG_NAME="oscam"
|
||||||
PKG_VERSION="6136"
|
PKG_VERSION="6136"
|
||||||
PKG_REV="1"
|
PKG_REV="2"
|
||||||
PKG_ARCH="any"
|
PKG_ARCH="any"
|
||||||
PKG_LICENSE="GPL"
|
PKG_LICENSE="GPL"
|
||||||
PKG_SITE="http://streamboard.gmc.to/wiki/index.php/OSCam/en"
|
PKG_SITE="http://streamboard.gmc.to/wiki/index.php/OSCam/en"
|
||||||
|
@ -21,8 +21,15 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
|
. /etc/profile
|
||||||
|
|
||||||
|
LOCKDIR="/var/lock/"
|
||||||
|
LOCKFILE="oscam.disabled"
|
||||||
|
|
||||||
# Check if process is already running
|
# Check if process is already running
|
||||||
if [ ! $(pidof oscam) ]; then
|
# use "$(pidof)" instead of $(pidof). otherwise 'if' statement will fail
|
||||||
|
# because oscam spawns at least one 'extra' process
|
||||||
|
if [ ! "$(pidof oscam)" ]; then
|
||||||
|
|
||||||
ADDON_DIR="$HOME/.xbmc/addons/service.softcam.oscam"
|
ADDON_DIR="$HOME/.xbmc/addons/service.softcam.oscam"
|
||||||
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.softcam.oscam"
|
ADDON_HOME="$HOME/.xbmc/userdata/addon_data/service.softcam.oscam"
|
||||||
@ -65,10 +72,14 @@ if [ ! $(pidof oscam) ]; then
|
|||||||
touch $ADDON_CONF_USER
|
touch $ADDON_CONF_USER
|
||||||
|
|
||||||
# Restart process if it terminates.
|
# Restart process if it terminates.
|
||||||
(
|
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
|
||||||
while true; do
|
rm -rf "$LOCKDIR/$LOCKFILE"
|
||||||
oscam $OSCAM_ARG > /dev/null 2>&1
|
fi
|
||||||
usleep 250000
|
while [ true ] ; do
|
||||||
done
|
if [ -f "$LOCKDIR/$LOCKFILE" ] ; then
|
||||||
)&
|
break
|
||||||
|
fi
|
||||||
|
oscam $OSCAM_ARG > /dev/null 2>&1
|
||||||
|
sleep 1
|
||||||
|
done &
|
||||||
fi
|
fi
|
35
packages/addons/service/softcam/oscam/source/bin/oscam.stop
Executable file
35
packages/addons/service/softcam/oscam/source/bin/oscam.stop
Executable file
@ -0,0 +1,35 @@
|
|||||||
|
#!/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
|
||||||
|
|
||||||
|
LOCKDIR="/var/lock/"
|
||||||
|
LOCKFILE="oscam.disabled"
|
||||||
|
|
||||||
|
# use "$(pidof)" instead of $(pidof). otherwise 'if' statement will fail
|
||||||
|
# because oscam spawns at least one 'extra' process
|
||||||
|
if [ "$(pidof oscam)" ];then
|
||||||
|
mkdir -p "$LOCKDIR"
|
||||||
|
touch "$LOCKDIR/$LOCKFILE"
|
||||||
|
killall -9 oscam
|
||||||
|
fi
|
||||||
|
|
@ -19,6 +19,22 @@
|
|||||||
# http://www.gnu.org/copyleft/gpl.html
|
# http://www.gnu.org/copyleft/gpl.html
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
import xbmc, time, os, subprocess
|
import xbmc, time, os, subprocess, xbmcaddon
|
||||||
|
|
||||||
os.system("oscam.service")
|
__scriptname__ = "OSCAM Service"
|
||||||
|
__author__ = "OpenELEC"
|
||||||
|
__url__ = "http://www.openelec.tv"
|
||||||
|
__settings__ = xbmcaddon.Addon(id='service.softcam.oscam')
|
||||||
|
__cwd__ = __settings__.getAddonInfo('path')
|
||||||
|
__start__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "oscam.start") )
|
||||||
|
__stop__ = xbmc.translatePath( os.path.join( __cwd__, 'bin', "oscam.stop") )
|
||||||
|
|
||||||
|
#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)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user