-->![Cccam c line manager roles Cccam c line manager roles](/uploads/1/2/6/4/126400498/696385891.jpg)
![Cccam C Line Manager Role Cccam C Line Manager Role](/uploads/1/2/6/4/126400498/563375596.jpg)
May 09, 2011 CCcam Web Manager V.1.0 CCcam Web Manager allows you to handle almost any file cccam.cfg web. Se le trova la disabilita F-Line 3. Crea il file CCcam.cfg 4. Copia del giorno precedente CCcam.cfg e lo rinomina 5. Copia il file CCcam.cfg generator in automatico in / var / etc 6. Permessi setta and a 755 7. Riavvia con il nuovo CCcam.x86 CCcam. Add C-Line from your friend = If someone gives you a cline, you simply paste it here and click the button ‘Add C-Line to CCcam’ and you’ll see it added to the bottom of your config. Click button 3. ‘Save CCcam.cfg to dream’ to send the new config to your box and start your new line working.
Applies to: System Center Configuration Manager (Current Branch)
Administrators use the Configuration Manager console to manage the Configuration Manager environment. Each Configuration Manager console can connect to a central administration site (CAS) or to a primary site. You can't connect a Configuration Manager console to a secondary site.
The Configuration Manager console is always installed on the site server for the CAS or a primary site. To install the console separate from site server installation, run the standalone installer.
Prerequisites
- You have local Administrator rights on the target computer for the console.
- You have Read permissions to the location of the Configuration Manager console installation files.
Source paths
Decide which source path to use:
- ConsoleSetup folder on the site server:
<Configuration Manager site server installation path>ToolsConsoleSetup
When you install a site server, it copies the console installation files and supported language packs for the site to the ToolsConsoleSetup subfolder. Optionally, you can copy the ConsoleSetup folder to an alternate location to start the installation. When you update the site, it always keeps its local version up to date. - Configuration Manager installation media:
<Configuration Manager installation media>SMSSETUPBINI386
Installing the Configuration Manager console from the installation media always installs the English version. This behavior happens even if the site server supports different languages, or the target computer's OS is set to a different language.
When possible, start the console installer from the ConsoleSetup folder rather than from the source media.
Important
Don't install the console using the CD.Latest source files. It's an unsupported scenario, and may cause problems with the console installation. For more information, see The CD.Latest folder.
If you create a package for installing the console on other computers, make sure the package includes the following files:
- ConsoleSetup.exe
- AdminConsole.msi
- ConfigMgr.AC_Extension.i386.cab (starting in version 1902)
- ConfigMgr.AC_Extension.amd64.cab (starting in version 1902)
Use the Setup Wizard
- Browse to the source path, and open ConsoleSetup.exe.ImportantAlways install the console by using ConsoleSetup.exe. Although you can install the Configuration Manager console by running AdminConsole.msi, this method doesn't run prerequisites or dependency checks. The installation might not install correctly.
- In the wizard, select Next.
- On the Site Server page, enter the fully qualified domain name (FQDN) of the site server to which the Configuration Manager console connects.
- On the Installation Folder page, enter the installation folder for the Configuration Manager console. The folder path can't include trailing spaces or Unicode characters.
- On the Customer Experience Improvement Program page, select whether to join the Customer Experience Improvement Program (CEIP).NoteStarting in Configuration Manager version 1802, the CEIP feature is removed from the product.
- On the Ready to Install page, select Install.
Install from a command prompt
Tip
Installing the Configuration Manager console from a command prompt always installs the English version. This behavior happens even if the target computer's OS is set to a different language. To install the Configuration Manager console in a language other than English, use the Setup Wizard.
ConsoleSetup.exe command-line options
/q
Installs the Configuration Manager console unattended. The EnableSQM, TargetDir, and DefaultSiteServerName options are required when you use this option.
/uninstall
Uninstalls the Configuration Manager console. Specify this option first when you use it with the /q option.
LangPackDir
Specifies the path to the folder that contains the language files. You can use Setup Downloader to download the language files. If you don't use this option, Setup looks for the language folder in the current folder. If the language folder isn't found, Setup continues to install English only. For more information, see Setup Downloader.
TargetDir
![Cccam c line manager roles Cccam c line manager roles](/uploads/1/2/6/4/126400498/696385891.jpg)
Specifies the installation folder to install the Configuration Manager console. This option is required when you use the /q option.
EnableSQM
C Line Shipping
Specifies whether to join the Customer Experience Improvement Program (CEIP). Use a value of 1 to join the CEIP, and a value of 0 to not join the program. This option is required when you use the /q option.
Important
Starting in Configuration Manager version 1802, the CEIP feature is removed from the product. Using the parameter will cause the install to fail.
DefaultSiteServerName
Directly Yours
Specifies the FQDN of the site server to which the console connects when it opens. This option is required when you use the /q option.
Examples
C Line Mta
Important
For version 1802 and later, don't include the EnableSQM parameter
Cccam C Line
Silent install
ConsoleSetup.exe /q TargetDir='%ProgramFiles%ConfigMgr Console' DefaultSiteServerName=MyServer.Contoso.com
Silent install with language packs
ConsoleSetup.exe /q TargetDir='C:Program FilesConfigMgr Console' DefaultSiteServerName=MyServer.Contoso.com LangPackDir=C:DownloadsConfigMgr
Silent uninstall
ConsoleSetup.exe /uninstall /q
See also
An administrator sees objects in the console based on the permissions assigned to their user account. For more information, see Fundamentals of role-based administration.
For more information on the fundamentals of navigating the Configuration Manager console, see Using the console.
Cccam C Line Manager Roles
PermalinkJoin GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.
Sign up Find file Copy path
![Cccam C Line Manager Role Cccam C Line Manager Role](/uploads/1/2/6/4/126400498/563375596.jpg)
Cannot retrieve contributors at this time
# for localized messages |
import re |
from os import path, makedirs, remove, rename, symlink, mkdir, listdir |
from datetime import datetime |
from time import time, sleep |
from enigma import eTimer |
from . import _, PluginLanguageDomain |
import Components.Task |
from Components.ActionMap import ActionMap |
from Components.Label import Label |
from Components.Button import Button |
from Components.ScrollLabel import ScrollLabel |
from Components.Pixmap import MultiPixmap |
from Components.config import configfile, config, ConfigSubsection, ConfigYesNo, ConfigNumber, ConfigLocations |
from Components.Console import Console |
from Components.FileList import MultiFileSelectList |
from Components.PluginComponent import plugins |
from Components.Sources.StaticText import StaticText |
from Tools.Directories import resolveFilename, SCOPE_PLUGINS |
from Screens.Screen import Screen |
from Screens.MessageBox import MessageBox |
from Components.SystemInfo import SystemInfo |
config.softcammanager = ConfigSubsection() |
config.softcammanager.softcams_autostart = ConfigLocations(default='') |
config.softcammanager.softcamtimerenabled = ConfigYesNo(default=True) |
config.softcammanager.softcamtimer = ConfigNumber(default=6) |
config.softcammanager.showinextensions = ConfigYesNo(default=True) |
softcamautopoller =None |
defupdateExtensions(configElement): |
plugins.clearPluginList() |
plugins.readPluginList(resolveFilename(SCOPE_PLUGINS)) |
config.softcammanager.showinextensions.addNotifier(updateExtensions, initial_call=False) |
defSoftcamAutostart(reason, session=None, **kwargs): |
''called with reason=1 to during shutdown, with reason=0 at startup?'' |
global softcamautopoller |
if reason 0: |
print'[SoftcamManager] AutoStart Enabled' |
if path.exists('/tmp/SoftcamsDisableCheck'): |
remove('/tmp/SoftcamsDisableCheck') |
softcamautopoller = SoftcamAutoPoller() |
softcamautopoller.start() |
elif reason 1: |
# Stop Poller |
if softcamautopoller isnotNone: |
softcamautopoller.stop() |
softcamautopoller =None |
classVIXSoftcamManager(Screen): |
skin ='' |
<screen name='VIXSoftcamManager' position='center,center' size='560,400'> |
<ePixmap pixmap='buttons/red.png' position='0,0' size='140,40' alphatest='on'/> |
<ePixmap pixmap='buttons/green.png' position='140,0' size='140,40' alphatest='on'/> |
<ePixmap pixmap='buttons/yellow.png' position='280,0' size='140,40' alphatest='on'/> |
<ePixmap pixmap='buttons/blue.png' position='420,0' size='140,40' alphatest='on'/> |
<widget name='key_red' position='0,0' zPosition='1' size='140,40' font='Regular;20' halign='center' valign='center' backgroundColor='#9f1313' transparent='1'/> |
<widget name='key_green' position='140,0' zPosition='1' size='140,40' font='Regular;20' halign='center' valign='center' backgroundColor='#1f771f' transparent='1'/> |
<widget name='key_yellow' position='280,0' zPosition='1' size='140,40' font='Regular;20' halign='center' valign='center' backgroundColor='#a08500' transparent='1'/> |
<widget name='key_blue' position='420,0' zPosition='1' size='140,40' font='Regular;20' halign='center' valign='center' backgroundColor='#a08500' transparent='1'/> |
<widget name='lab1' position='40,60' size='170,20' font='Regular; 22' halign='right' zPosition='2' transparent='0'/> |
<widget name='list' position='225,60' size='240,100' transparent='0' scrollbarMode='showOnDemand'/> |
<widget name='lab2' position='40,165' size='170,30' font='Regular; 22' halign='right' zPosition='2' transparent='0'/> |
<widget name='activecam' position='225,166' size='240,100' font='Regular; 20' halign='left' zPosition='2' transparent='0' noWrap='1'/> |
<applet type='onLayoutFinish'> |
self['list'].instance.setItemHeight(25) |
</applet> |
</screen>'' |
def__init__(self, session): |
Screen.__init__(self, session) |
screentitle = _('Softcam manager') |
self.menu_path = _('Main menu')+' / '+_('Setup')+' / '+_('Softcam')+' / ' |
if config.usage.show_menupath.value 'large': |
self.menu_path += screentitle |
title =self.menu_path |
self['menu_path_compressed'] = StaticText('') |
self.menu_path +=' / ' |
elif config.usage.show_menupath.value 'small': |
title = screentitle |
self['menu_path_compressed'] = StaticText(self.menu_path +' >'ifnotself.menu_path.endswith(' / ') elseself.menu_path[:-3] +' >'or'') |
self.menu_path +=' / '+ screentitle |
else: |
title = screentitle |
self['menu_path_compressed'] = StaticText('') |
Screen.setTitle(self, title) |
self['lab1'] = Label(_('Select:')) |
self['lab2'] = Label(_('Active:')) |
self['activecam'] = Label() |
self.onChangedEntry = [] |
self.sentsingle ='' |
self.selectedFiles = config.softcammanager.softcams_autostart.value |
self.defaultDir ='/usr/softcams/' |
self.emlist = MultiFileSelectList(self.selectedFiles, self.defaultDir, showDirectories=False) |
self['list'] =self.emlist |
self['myactions'] = ActionMap(['ColorActions', 'OkCancelActions', 'DirectionActions', 'TimerEditActions', 'MenuActions'], |
{ |
'ok': self.keyStart, |
'cancel': self.close, |
'red': self.close, |
'green': self.keyStart, |
'yellow': self.getRestartPID, |
'blue': self.changeSelectionState, |
'log': self.showLog, |
'menu': self.createSetup, |
}, -1) |
self['key_red'] = Button(_('Close')) |
self['key_green'] = Button('') |
self['key_yellow'] = Button('') |
self['key_blue'] = Button(_('Autostart')) |
self.currentactivecam ='' |
self.activityTimer = eTimer() |
self.activityTimer.timeout.get().append(self.getActivecam) |
self.Console = Console() |
self.showActivecam() |
ifnotself.selectionChanged inself['list'].onSelectionChanged: |
self['list'].onSelectionChanged.append(self.selectionChanged) |
defcreateSummary(self): |
from Screens.PluginBrowser import PluginBrowserSummary |
return PluginBrowserSummary |
defcreateSetup(self): |
from Screens.Setup import Setup |
self.session.open(Setup, 'vixsoftcammanager', 'SystemPlugins/ViX', self.menu_path, PluginLanguageDomain) |
defselectionChanged(self): |
cams = [] |
if path.exists('/usr/softcams/'): |
cams = listdir('/usr/softcams') |
SystemInfo['CCcamInstalled'] =False |
SystemInfo['OScamInstalled'] =False |
for softcam in cams: |
if softcam.lower().startswith('cccam'): |
SystemInfo['CCcamInstalled'] =True |
elif softcam.lower().startswith('oscam'): |
SystemInfo['OScamInstalled'] =True |
selcam ='' |
if cams: |
current =self['list'].getCurrent()[0] |
selcam = current[0] |
print'[SoftcamManager] Selectedcam: '+str(selcam) |
ifself.currentactivecam.find(selcam) <0: |
self['key_green'].setText(_('Start')) |
else: |
self['key_green'].setText(_('Stop')) |
ifself.currentactivecam.find(selcam) <0: |
self['key_yellow'].setText('') |
else: |
self['key_yellow'].setText(_('Restart')) |
if current[2] isTrue: |
self['key_blue'].setText(_('Disable startup')) |
else: |
self['key_blue'].setText(_('Enable startup')) |
self.saveSelection() |
desc = _('Active:') +''+self['activecam'].text |
for cb inself.onChangedEntry: |
cb(selcam, desc) |
defchangeSelectionState(self): |
cams = [] |
if path.exists('/usr/softcams/'): |
cams = listdir('/usr/softcams') |
if cams: |
self['list'].changeSelectionState() |
self.selectedFiles =self['list'].getSelectedList() |
defsaveSelection(self): |
self.selectedFiles =self['list'].getSelectedList() |
config.softcammanager.softcams_autostart.value =self.selectedFiles |
config.softcammanager.softcams_autostart.save() |
configfile.save() |
defshowActivecam(self): |
scanning = _('Wait please while scanningnfor softcam's...') |
self['activecam'].setText(scanning) |
self.activityTimer.start(10) |
defgetActivecam(self): |
self.activityTimer.stop() |
active = [] |
for x inself['list'].list: |
active.append(x[0][0]) |
activelist =','.join(active) |
if activelist: |
self.Console.ePopen('ps.procps -C '+ activelist +' | grep -v 'CMD' | sed 's/</ /g' | awk '{print $4}' | awk '{a[$1] = $0} END { for (x in a) { print a[x] } }'', self.showActivecam2) |
else: |
self['activecam'].setText('') |
self['activecam'].show() |
# self.Console.ePopen('ps.procps | grep softcams | grep -v 'grep' | sed 's/</ /g' | awk '{print $5}' | awk '{a[$1] = $0} END { for (x in a) { print a[x] } }' | awk -F'[/]' '{print $4}', self.showActivecam2) |
defshowActivecam2(self, result, retval, extra_args): |
if retval 0: |
self.currentactivecamtemp = result |
self.currentactivecam =''.join([s for s inself.currentactivecamtemp.splitlines(True) if s.strip('rn')]) |
self.currentactivecam =self.currentactivecam.replace('n', ', ') |
print'[SoftcamManager] Active: '+self.currentactivecam.replace('n', ', ') |
if path.exists('/tmp/SoftcamsScriptsRunning'): |
file=open('/tmp/SoftcamsScriptsRunning') |
SoftcamsScriptsRunning =file.read() |
file.close() |
SoftcamsScriptsRunning = SoftcamsScriptsRunning.replace('n', ', ') |
self.currentactivecam += SoftcamsScriptsRunning |
self['activecam'].setText(self.currentactivecam) |
self['activecam'].show() |
else: |
print'[SoftcamManager] RESULT FAILED: '+str(result) |
self.selectionChanged() |
defkeyStart(self): |
cams = [] |
if path.exists('/usr/softcams/'): |
cams = listdir('/usr/softcams') |
if cams: |
self.sel =self['list'].getCurrent()[0] |
selcam =self.sel[0] |
ifself.currentactivecam.find(selcam) <0: |
if selcam.lower().startswith('cccam'): |
ifnot path.exists('/etc/CCcam.cfg'): |
self.session.open(MessageBox, _('No config files found, please setup CCcam firstnin /etc/CCcam.cfg.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
else: |
ifself.currentactivecam.lower().find('mgcam') <0: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
else: |
self.session.open(MessageBox, _('CCcam can't run whilst MGcamd is running'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
elif selcam.lower().startswith('hypercam'): |
ifnot path.exists('/etc/hypercam.cfg'): |
self.session.open(MessageBox, _('No config files found, please setup Hypercam firstnin /etc/hypercam.cfg.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
else: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
elif selcam.lower().startswith('oscam'): |
ifnot path.exists('/etc/tuxbox/config/oscam.conf'): |
self.session.open(MessageBox, _('No config files found, please setup Oscam firstnin /etc/tuxbox/config'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
else: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
elif selcam.lower().startswith('mgcam'): |
ifnot path.exists('/var/keys/mg_cfg'): |
ifself.currentactivecam.lower().find('cccam') <0: |
self.session.open(MessageBox, _('No config files found, please setup MGcamd firstnin /usr/keys.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
else: |
self.session.open(MessageBox, _('MGcamd can't run whilst CCcam is running.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
else: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
elif selcam.lower().startswith('scam'): |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
else: |
self.session.open(MessageBox, _('Found non-standard softcam, trying to start, this may fail.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
else: |
self.session.openWithCallback(self.showActivecam, VIXStopCam, self.sel[0]) |
defgetRestartPID(self): |
cams = [] |
if path.exists('/usr/softcams/'): |
cams = listdir('/usr/softcams') |
if cams: |
self.sel =self['list'].getCurrent()[0] |
selectedcam =self.sel[0] |
self.Console.ePopen('pidof '+ selectedcam, self.keyRestart, selectedcam) |
defkeyRestart(self, result, retval, extra_args): |
selectedcam = extra_args |
strpos =self.currentactivecam.find(selectedcam) |
if strpos <0: |
return |
else: |
if retval 0: |
stopcam =str(result) |
print'[SoftcamManager] Stopping '+ selectedcam +' PID '+ stopcam.replace('n', '') |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Stopping: '+ selectedcam +'n') |
output.close() |
self.Console.ePopen('kill -9 '+ stopcam.replace('n', '')) |
sleep(4) |
else: |
print'[SoftcamManager] RESULT FAILED: '+str(result) |
if selectedcam.lower().startswith('cccam') and path.exists('/etc/CCcam.cfg') True: |
ifself.currentactivecam.lower().find('mgcam') <0: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
else: |
self.session.open(MessageBox, _('CCcam can't run whilst MGcamd is running.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
elif selectedcam.lower().startswith('cccam') and path.exists('/etc/CCcam.cfg') False: |
self.session.open(MessageBox, _('No config files found, please setup CCcam firstnin /etc/CCcam.cfg.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
elif selectedcam.lower().startswith('oscam') and path.exists('/etc/tuxbox/config/oscam.conf') True: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
elif selectedcam.lower().startswith('oscam') and path.exists('/etc/tuxbox/config/oscam.conf') False: |
ifnot path.exists('/etc/tuxbox/config'): |
makedirs('/etc/tuxbox/config') |
self.session.open(MessageBox, _('No config files found, please setup Oscam firstnin /etc/tuxbox/config.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
elif selectedcam.lower().startswith('mgcam') and path.exists('/var/keys/mg_cfg') True: |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
elif selectedcam.lower().startswith('mgcam') and path.exists('/var/keys/mg_cfg') False: |
ifself.currentactivecam.lower().find('cccam') <0: |
self.session.open(MessageBox, _('No config files found, please setup MGcamd firstnin /usr/keys.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
else: |
self.session.open(MessageBox, _('MGcamd can't run whilst CCcam is running.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
elif selectedcam.lower().startswith('scam'): |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
elifnot selectedcam.lower().startswith('cccam') or selectedcam.lower().startswith('oscam') or selectedcam.lower().startswith('mgcamd'): |
self.session.open(MessageBox, _('Found non-standard softcam, trying to start, this may fail.'), MessageBox.TYPE_INFO, timeout=10, close_on_any_key=True) |
self.session.openWithCallback(self.showActivecam, VIXStartCam, self.sel[0]) |
defshowLog(self): |
self.session.open(VIXSoftcamLog, self.menu_path) |
defmyclose(self): |
self.close() |
classVIXStartCam(Screen): |
skin ='' |
<screen name='VIXStartCam' position='center,center' size='484, 150'> |
<widget name='connect' position='217, 0' size='64,64' zPosition='2' pixmaps='ViX_HD_Common/busy/busy1.png,ViX_HD_Common/busy/busy2.png,ViX_HD_Common/busy/busy3.png,ViX_HD_Common/busy/busy4.png,ViX_HD_Common/busy/busy5.png,ViX_HD_Common/busy/busy6.png,ViX_HD_Common/busy/busy7.png,ViX_HD_Common/busy/busy8.png,ViX_HD_Common/busy/busy9.png,ViX_HD_Common/busy/busy9.png,ViX_HD_Common/busy/busy10.png,ViX_HD_Common/busy/busy11.png,ViX_HD_Common/busy/busy12.png,ViX_HD_Common/busy/busy13.png,ViX_HD_Common/busy/busy14.png,ViX_HD_Common/busy/busy15.png,ViX_HD_Common/busy/busy17.png,ViX_HD_Common/busy/busy18.png,ViX_HD_Common/busy/busy19.png,ViX_HD_Common/busy/busy20.png,ViX_HD_Common/busy/busy21.png,ViX_HD_Common/busy/busy22.png,ViX_HD_Common/busy/busy23.png,ViX_HD_Common/busy/busy24.png' transparent='1' alphatest='blend'/> |
<widget name='lab1' position='10, 80' halign='center' size='460, 60' zPosition='1' font='Regular;20' valign='top' transparent='1'/> |
</screen>'' |
def__init__(self, session, selectedcam): |
Screen.__init__(self, session) |
Screen.setTitle(self, _('Softcam starting...')) |
self['connect'] = MultiPixmap() |
self['lab1'] = Label(_('Please wait while startingn') + selectedcam +'...') |
global startselectedcam |
startselectedcam = selectedcam |
self.Console = Console() |
self.activityTimer = eTimer() |
self.activityTimer.timeout.get().append(self.updatepix) |
self.onShow.append(self.startShow) |
self.onClose.append(self.delTimer) |
defstartShow(self): |
self.curpix =0 |
self.count =0 |
self['connect'].setPixmapNum(0) |
if startselectedcam.endswith('.sh'): |
if path.exists('/tmp/SoftcamsScriptsRunning'): |
file=open('/tmp/SoftcamsScriptsRunning') |
data =file.read() |
file.close() |
if data.find(startselectedcam) >=0: |
filewrite =open('/tmp/SoftcamsScriptsRunning.tmp', 'w') |
fileread =open('/tmp/SoftcamsScriptsRunning') |
filewrite.writelines([l for l in fileread.readlines() if startselectedcam notin l]) |
fileread.close() |
filewrite.close() |
rename('/tmp/SoftcamsScriptsRunning.tmp', '/tmp/SoftcamsScriptsRunning') |
elif data.find(startselectedcam) <0: |
fileout =open('/tmp/SoftcamsScriptsRunning', 'a') |
line = startselectedcam +'n' |
fileout.write(line) |
fileout.close() |
else: |
fileout =open('/tmp/SoftcamsScriptsRunning', 'w') |
line = startselectedcam +'n' |
fileout.write(line) |
fileout.close() |
print'[SoftcamManager] Starting '+ startselectedcam |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Starting '+ startselectedcam +'n') |
output.close() |
self.Console.ePopen('/usr/softcams/'+ startselectedcam +' start') |
else: |
if path.exists('/tmp/SoftcamsDisableCheck'): |
file=open('/tmp/SoftcamsDisableCheck') |
data =file.read() |
file.close() |
if data.find(startselectedcam) >=0: |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Initialised timed check for '+ stopselectedcam +'n') |
output.close() |
fileread =open('/tmp/SoftcamsDisableCheck') |
filewrite =open('/tmp/SoftcamsDisableCheck.tmp', 'w') |
filewrite.writelines([l for l in fileread.readlines() if startselectedcam notin l]) |
fileread.close() |
filewrite.close() |
rename('/tmp/SoftcamsDisableCheck.tmp', '/tmp/SoftcamsDisableCheck') |
print'[SoftcamManager] Starting '+ startselectedcam |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Starting '+ startselectedcam +'n') |
output.close() |
if startselectedcam.lower().startswith('hypercam'): |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ startselectedcam +' -c /etc/hypercam.cfg') |
elif startselectedcam.lower().startswith('oscam'): |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ startselectedcam +' -b') |
elif startselectedcam.lower().startswith('gbox'): |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ startselectedcam) |
sleep(3) |
self.Console.ePopen('start-stop-daemon --start --quiet --background --exec /usr/bin/gbox') |
else: |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ startselectedcam) |
self.activityTimer.start(1) |
defupdatepix(self): |
self.activityTimer.stop() |
if startselectedcam.lower().startswith('cccam'): |
ifself.curpix >23: |
self.curpix =0 |
ifself.count >120: |
self.curpix =23 |
self['connect'].setPixmapNum(self.curpix) |
ifself.count 120: # timer on screen |
self.hide() |
self.close() |
self.activityTimer.start(120) # cycle speed |
self.curpix +=1 |
self.count +=1 |
else: |
ifself.curpix >23: |
self.curpix =0 |
ifself.count >23: |
self.curpix =0 |
self['connect'].setPixmapNum(self.curpix) |
ifself.count 25: # timer on screen |
self.hide() |
self.close() |
self.activityTimer.start(120) # cycle speed |
self.curpix +=1 |
self.count +=1 |
defdelTimer(self): |
delself.activityTimer |
classVIXStopCam(Screen): |
skin ='' |
<screen name='VIXStopCam' position='center,center' size='484, 150'> |
<widget name='connect' position='217, 0' size='64,64' zPosition='2' pixmaps='ViX_HD_Common/busy/busy1.png,ViX_HD_Common/busy/busy2.png,ViX_HD_Common/busy/busy3.png,ViX_HD_Common/busy/busy4.png,ViX_HD_Common/busy/busy5.png,ViX_HD_Common/busy/busy6.png,ViX_HD_Common/busy/busy7.png,ViX_HD_Common/busy/busy8.png,ViX_HD_Common/busy/busy9.png,ViX_HD_Common/busy/busy9.png,ViX_HD_Common/busy/busy10.png,ViX_HD_Common/busy/busy11.png,ViX_HD_Common/busy/busy12.png,ViX_HD_Common/busy/busy13.png,ViX_HD_Common/busy/busy14.png,ViX_HD_Common/busy/busy15.png,ViX_HD_Common/busy/busy17.png,ViX_HD_Common/busy/busy18.png,ViX_HD_Common/busy/busy19.png,ViX_HD_Common/busy/busy20.png,ViX_HD_Common/busy/busy21.png,ViX_HD_Common/busy/busy22.png,ViX_HD_Common/busy/busy23.png,ViX_HD_Common/busy/busy24.png' transparent='1' alphatest='blend'/> |
<widget name='lab1' position='10, 80' halign='center' size='460, 60' zPosition='1' font='Regular;20' valign='top' transparent='1'/> |
</screen>'' |
def__init__(self, session, selectedcam): |
Screen.__init__(self, session) |
global stopselectedcam |
stopselectedcam = selectedcam |
Screen.setTitle(self, _('Softcam stopping...')) |
self['connect'] = MultiPixmap() |
self['lab1'] = Label(_('Please wait while stoppingn') + selectedcam +'...') |
self.Console = Console() |
self.activityTimer = eTimer() |
self.activityTimer.timeout.get().append(self.updatepix) |
self.onShow.append(self.getStopPID) |
self.onClose.append(self.delTimer) |
defgetStopPID(self): |
if stopselectedcam.endswith('.sh'): |
self.curpix =0 |
self.count =0 |
self['connect'].setPixmapNum(0) |
print'[SoftcamManager] Stopping '+ stopselectedcam |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Stopping '+ stopselectedcam +'n') |
output.close() |
self.Console.ePopen('/usr/softcams/'+ stopselectedcam +' stop') |
if path.exists('/tmp/SoftcamsScriptsRunning'): |
remove('/tmp/SoftcamsScriptsRunning') |
if path.exists('/etc/SoftcamsAutostart'): |
file=open('/etc/SoftcamsAutostart') |
data =file.read() |
file.close() |
finddata = data.find(stopselectedcam) |
if data.find(stopselectedcam) >=0: |
print'[SoftcamManager] Temporarily disabled timed check for '+ stopselectedcam |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Temporarily disabled timed check for '+ stopselectedcam +'n') |
output.close() |
fileout =open('/tmp/SoftcamsDisableCheck', 'a') |
line = stopselectedcam +'n' |
fileout.write(line) |
fileout.close() |
self.activityTimer.start(1) |
else: |
self.Console.ePopen('pidof '+ stopselectedcam, self.startShow) |
defstartShow(self, result, retval, extra_args): |
if retval 0: |
self.curpix =0 |
self.count =0 |
self['connect'].setPixmapNum(0) |
stopcam =str(result) |
if path.exists('/etc/SoftcamsAutostart'): |
file=open('/etc/SoftcamsAutostart') |
data =file.read() |
file.close() |
finddata = data.find(stopselectedcam) |
if data.find(stopselectedcam) >=0: |
print'[SoftcamManager] Temporarily disabled timed check for '+ stopselectedcam |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Temporarily disabled timed check for '+ stopselectedcam +'n') |
output.close() |
fileout =open('/tmp/SoftcamsDisableCheck', 'a') |
line = stopselectedcam +'n' |
fileout.write(line) |
fileout.close() |
print'[SoftcamManager] Stopping '+ stopselectedcam +' PID '+ stopcam.replace('n', '') |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Stopping '+ stopselectedcam +'n') |
output.close() |
self.Console.ePopen('kill -9 '+ stopcam.replace('n', '')) |
self.activityTimer.start(1) |
defupdatepix(self): |
self.activityTimer.stop() |
ifself.curpix >23: |
self.curpix =0 |
ifself.count >23: |
self.curpix =0 |
self['connect'].setPixmapNum(self.curpix) |
ifself.count 25: # timer on screen |
self.hide() |
self.close() |
self.activityTimer.start(120) # cycle speed |
self.curpix +=1 |
self.count +=1 |
defdelTimer(self): |
delself.activityTimer |
classVIXSoftcamLog(Screen): |
skin ='' |
<screen name='VIXSoftcamLog' position='center,center' size='560,400'> |
<widget name='list' position='0,0' size='560,400' font='Regular;14'/> |
</screen>'' |
def__init__(self, session, menu_path): |
self.session = session |
Screen.__init__(self, session) |
screentitle = _('Logs') |
if config.usage.show_menupath.value 'large': |
menu_path += screentitle |
title = menu_path |
self['menu_path_compressed'] = StaticText('') |
elif config.usage.show_menupath.value 'small': |
title = screentitle |
self['menu_path_compressed'] = StaticText(menu_path +' >'ifnot menu_path.endswith(' / ') else menu_path[:-3] +' >'or'') |
else: |
title = screentitle |
self['menu_path_compressed'] = StaticText('') |
Screen.setTitle(self, title) |
if path.exists('/var/volatile/tmp/cam.check.log'): |
file=open('/var/volatile/tmp/cam.check.log') |
softcamlog =file.read() |
file.close() |
else: |
softcamlog ='' |
self['list'] = ScrollLabel(str(softcamlog)) |
self['setupActions'] = ActionMap(['SetupActions', 'ColorActions', 'DirectionActions'], |
{ |
'cancel': self.cancel, |
'ok': self.cancel, |
'up': self['list'].pageUp, |
'down': self['list'].pageDown |
}, -2) |
defcancel(self): |
self.close() |
classSoftcamAutoPoller: |
''Automatically Poll SoftCam'' |
def__init__(self): |
# Init Timer |
ifnot path.exists('/usr/softcams'): |
mkdir('/usr/softcams', 0755) |
ifnot path.exists('/etc/scce'): |
mkdir('/etc/scce', 0755) |
ifnot path.exists('/etc/tuxbox/config'): |
mkdir('/etc/tuxbox/config', 0755) |
ifnot path.islink('/var/tuxbox'): |
symlink('/etc/tuxbox', '/var/tuxbox') |
ifnot path.exists('/usr/keys'): |
mkdir('/usr/keys', 0755) |
ifnot path.islink('/var/keys'): |
symlink('/usr/keys', '/var/keys') |
ifnot path.islink('/etc/keys'): |
symlink('/usr/keys', '/etc/keys') |
ifnot path.islink('/var/scce'): |
symlink('/etc/scce', '/var/scce') |
self.timer = eTimer() |
defstart(self): |
ifself.softcam_check notinself.timer.callback: |
self.timer.callback.append(self.softcam_check) |
self.timer.startLongTimer(10) |
defstop(self): |
ifself.softcam_check inself.timer.callback: |
self.timer.callback.remove(self.softcam_check) |
self.timer.stop() |
defsoftcam_check(self): |
now =int(time()) |
if path.exists('/tmp/SoftcamRuningCheck.tmp'): |
remove('/tmp/SoftcamRuningCheck.tmp') |
if config.softcammanager.softcams_autostart: |
Components.Task.job_manager.AddJob(self.createCheckJob()) |
if config.softcammanager.softcamtimerenabled.value: |
# print '[SoftcamManager] Timer Check Enabled' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Timer Check Enabledn') |
output.close() |
self.timer.startLongTimer(config.softcammanager.softcamtimer.value *60) |
else: |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Timer Check Disabledn') |
output.close() |
# print '[SoftcamManager] Timer Check Disabled' |
softcamautopoller.stop() |
defcreateCheckJob(self): |
job = Components.Task.Job(_('SoftcamCheck')) |
task = Components.Task.PythonTask(job, _('Checking softcams...')) |
task.work =self.JobStart |
task.weighting =1 |
return job |
defJobStart(self): |
self.autostartcams = config.softcammanager.softcams_autostart.value |
self.Console = Console() |
if path.exists('/tmp/cam.check.log'): |
if path.getsize('/tmp/cam.check.log') >40000: |
fh =open('/tmp/cam.check.log', 'rb+') |
fh.seek(-40000, 2) |
data = fh.read() |
fh.seek(0) # rewind |
fh.write(data) |
fh.truncate() |
fh.close() |
if path.exists('/etc/CCcam.cfg'): |
f =open('/etc/CCcam.cfg', 'r') |
logwarn ='' |
for line in f.readlines(): |
if line.find('LOG WARNINGS') !=-1: |
parts = line.strip().split() |
logwarn = parts[2] |
if logwarn.find(':') >=0: |
logwarn = logwarn.replace(':', '') |
if logwarn '': |
logwarn = parts[3] |
else: |
logwarn ='' |
if path.exists(logwarn): |
if path.getsize(logwarn) >40000: |
fh =open(logwarn, 'rb+') |
fh.seek(-40000, 2) |
data = fh.read() |
fh.seek(0) # rewind |
fh.write(data) |
fh.truncate() |
fh.close() |
f.close() |
for softcamcheck inself.autostartcams: |
softcamcheck = softcamcheck.replace('/usr/softcams/', '') |
softcamcheck = softcamcheck.replace('n', '') |
if softcamcheck.endswith('.sh'): |
if path.exists('/tmp/SoftcamsDisableCheck'): |
file=open('/tmp/SoftcamsDisableCheck') |
data =file.read() |
file.close() |
else: |
data ='' |
if data.find(softcamcheck) <0: |
if path.exists('/tmp/SoftcamsScriptsRunning'): |
file=open('/tmp/SoftcamsScriptsRunning') |
data =file.read() |
file.close() |
if data.find(softcamcheck) <0: |
fileout =open('/tmp/SoftcamsScriptsRunning', 'a') |
line = softcamcheck +'n' |
fileout.write(line) |
fileout.close() |
print'[SoftcamManager] Starting '+ softcamcheck |
self.Console.ePopen('/usr/softcams/'+ softcamcheck +' start') |
else: |
fileout =open('/tmp/SoftcamsScriptsRunning', 'w') |
line = softcamcheck +'n' |
fileout.write(line) |
fileout.close() |
print'[SoftcamManager] Starting '+ softcamcheck |
self.Console.ePopen('/usr/softcams/'+ softcamcheck +' start') |
else: |
if path.exists('/tmp/SoftcamsDisableCheck'): |
file=open('/tmp/SoftcamsDisableCheck') |
data =file.read() |
file.close() |
else: |
data ='' |
if data.find(softcamcheck) <0: |
import process |
p = process.ProcessList() |
softcamcheck_process =str(p.named(softcamcheck)).strip('[]') |
if softcamcheck_process !='': |
if path.exists('/tmp/frozen'): |
remove('/tmp/frozen') |
if path.exists('/tmp/status.html'): |
remove('/tmp/status.html') |
if path.exists('/tmp/index.html'): |
remove('/tmp/index.html') |
print'[SoftcamManager] '+ softcamcheck +' already running' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': '+ softcamcheck +' running OKn') |
output.close() |
if softcamcheck.lower().startswith('oscam'): |
if path.exists('/tmp/status.html'): |
remove('/tmp/status.html') |
port ='' |
if path.exists('/etc/tuxbox/config/oscam.conf'): |
oscamconf ='/etc/tuxbox/config/oscam.conf' |
f =open(oscamconf, 'r') |
for line in f.readlines(): |
if line.find('httpport') !=-1: |
port = re.sub('D', '', line) |
f.close() |
print'[SoftcamManager] Checking if '+ softcamcheck +' is frozen' |
if port '': |
port ='16000' |
self.Console.ePopen('wget -T 1 http://127.0.0.1:'+ port +'/status.html -O /tmp/status.html &> /tmp/frozen') |
sleep(2) |
f =open('/tmp/frozen') |
frozen = f.read() |
f.close() |
if frozen.find('Unauthorized') !=-1or frozen.find('Authorization Required') !=-1or frozen.find('Forbidden') !=-1or frozen.find('Connection refused') !=-1or frozen.find('100%') !=-1or path.exists('/tmp/status.html'): |
print'[SoftcamManager] '+ softcamcheck +' is responding like it should' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': '+ softcamcheck +' is responding like it shouldn') |
output.close() |
else: |
print'[SoftcamManager] '+ softcamcheck +' is frozen, Restarting...' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': '+ softcamcheck +' is frozen, Restarting...n') |
output.close() |
print'[SoftcamManager] Stopping '+ softcamcheck |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': AutoStopping: '+ softcamcheck +'n') |
output.close() |
self.Console.ePopen('killall -9 '+ softcamcheck) |
sleep(1) |
self.Console.ePopen('ps.procps | grep softcams | grep -v grep | awk 'NR1' | awk '{print $5}'| awk -F'[/]' '{print $4}' > /tmp/oscamRuningCheck.tmp') |
sleep(2) |
file=open('/tmp/oscamRuningCheck.tmp') |
cccamcheck_process =file.read() |
file.close() |
cccamcheck_process = cccamcheck_process.replace('n', '') |
if cccamcheck_process.lower().find('cccam') !=-1: |
try: |
print'[SoftcamManager] Stopping ', cccamcheck_process |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': AutoStopping: '+ cccamcheck_process +'n') |
output.close() |
self.Console.ePopen('killall -9 /usr/softcams/'+str(cccamcheck_process)) |
except: |
pass |
print'[SoftcamManager] Starting '+ softcamcheck |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': AutoStarting: '+ softcamcheck +'n') |
output.close() |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ softcamcheck +' -b') |
sleep(10) |
elif softcamcheck.lower().startswith('cccam'): |
if path.exists('/tmp/index.html'): |
remove('/tmp/index.html') |
allow ='no' |
port ='' |
f =open('/etc/CCcam.cfg', 'r') |
for line in f.readlines(): |
if line.find('ALLOW WEBINFO') !=-1: |
ifnot line.startswith('#'): |
parts = line.replace('ALLOW WEBINFO', '') |
parts = parts.replace(':', '') |
parts = parts.replace('', '') |
parts = parts.strip().split() |
if parts[0].startswith('yes'): |
allow = parts[0] |
if line.find('WEBINFO LISTEN PORT') !=-1: |
port = re.sub('D', '', line) |
f.close() |
if allow.lower().find('yes') !=-1: |
print'[SoftcamManager] Checking if '+ softcamcheck +' is frozen' |
if port '': |
port ='16001' |
self.Console.ePopen('wget -T 1 http://127.0.0.1:'+ port +' -O /tmp/index.html &> /tmp/frozen') |
sleep(2) |
f =open('/tmp/frozen') |
frozen = f.read() |
f.close() |
if frozen.find('Unauthorized') !=-1or frozen.find('Authorization Required') !=-1or frozen.find('Forbidden') !=-1or frozen.find('Connection refused') !=-1or frozen.find('100%') !=-1or path.exists('/tmp/index.html'): |
print'[SoftcamManager] '+ softcamcheck +' is responding like it should' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': '+ softcamcheck +' is responding like it shouldn') |
output.close() |
else: |
print'[SoftcamManager] '+ softcamcheck +' is frozen, Restarting...' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': '+ softcamcheck +' is frozen, Restarting...n') |
output.close() |
print'[SoftcamManager] Stopping '+ softcamcheck |
self.Console.ePopen('killall -9 '+ softcamcheck) |
sleep(1) |
print'[SoftcamManager] Starting '+ softcamcheck |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ softcamcheck) |
elif allow.lower().find('no') !=-1: |
print'[SoftcamManager] Telnet info not allowed, can not check if frozen' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Webinfo info not allowed, can not check if frozen,ntplease enable 'ALLOW WEBINFO: YES'n') |
output.close() |
else: |
print'[SoftcamManager] Webinfo info not setup, please enable 'ALLOW WEBINFO= YES'' |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Telnet info not setup, can not check if frozen,ntplease enable 'ALLOW WEBINFO: YES'n') |
output.close() |
elif softcamcheck_process '': |
print'[SoftcamManager] Couldn't find '+ softcamcheck +' running, Starting '+ softcamcheck |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': Couldn't find '+ softcamcheck +' running, Starting '+ softcamcheck +'n') |
output.close() |
if softcamcheck.lower().startswith('oscam'): |
self.Console.ePopen('ps.procps | grep softcams | grep -v grep | awk 'NR1' | awk '{print $5}'| awk -F'[/]' '{print $4}' > /tmp/softcamRuningCheck.tmp') |
sleep(2) |
file=open('/tmp/softcamRuningCheck.tmp') |
cccamcheck_process =file.read() |
cccamcheck_process = cccamcheck_process.replace('n', '') |
file.close() |
if cccamcheck_process.find('cccam') >=0or cccamcheck_process.find('CCcam') >=0: |
try: |
print'[SoftcamManager] Stopping ', cccamcheck_process |
output =open('/tmp/cam.check.log', 'a') |
now = datetime.now() |
output.write(now.strftime('%Y-%m-%d %H:%M') +': AutoStopping: '+ cccamcheck_process +'n') |
output.close() |
self.Console.ePopen('killall -9 /usr/softcams/'+str(cccamcheck_process)) |
except: |
pass |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ softcamcheck +' -b') |
sleep(10) |
remove('/tmp/softcamRuningCheck.tmp') |
elif softcamcheck.lower().startswith('sbox'): |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ softcamcheck) |
sleep(7) |
elif softcamcheck.lower().startswith('gbox'): |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ softcamcheck) |
sleep(3) |
self.Console.ePopen('start-stop-daemon --start --quiet --background --exec /usr/bin/gbox') |
else: |
self.Console.ePopen('ulimit -s 512;/usr/softcams/'+ softcamcheck) |
Copy lines Copy permalink