Ejemplo n.º 1
0
def stopSmartd(): 
    if smartd.daemonRunning():
        smartd.stopDaemon();
        if not smartd.daemonRunning():
            if showPopups:
                xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50025)+ ", 7, " + icon + ")");  # smartd stopped
        else:
            xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50026));   # Failed to stop smartd
Ejemplo n.º 2
0
def startSmartd(): 
    if not smartd.daemonRunning():
        smartd.startDaemon();
        if smartd.daemonRunning():
            if showPopups:
                xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50001)+ ", 7, " + __icon__ + ")");  # smartd started
        else:
            xbmc.log(consts.logHeader + "failed to start smartd", xbmc.LOGERROR);
            xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50024));   # Failed to start smartd
Ejemplo n.º 3
0
def stopSmartd():
    if smartd.daemonRunning():
        smartd.stopDaemon()
        if not smartd.daemonRunning():
            if showPopups:
                xbmc.executebuiltin("Notification(smartmontools, " +
                                    addon.getLocalizedString(50025) + ", 7, " +
                                    icon + ")")
                # smartd stopped
        else:
            xbmcgui.Dialog().ok(consts.dialogHeader,
                                addon.getLocalizedString(50026))
Ejemplo n.º 4
0
def listSmartdTasks():
    addFolderItem(consts.fontBold + consts.colorBlue + addon.getLocalizedString(50012) +       # smartd daemon tasks:
                  consts.colorEnd + consts.fontBoldEnd, -99); 
    if smartd.daemonRunning():
        addFolderItem(addon.getLocalizedString(50013), 3); # reload configuration file
        addFolderItem(addon.getLocalizedString(50014), 4); # run test now
        addFolderItem(addon.getLocalizedString(50015), 2); # stop
    else:
        addFolderItem(addon.getLocalizedString(50016), 1); # start
        
    addFolderItem(addon.getLocalizedString(50017), 5);    # show log
Ejemplo n.º 5
0
def startSmartd():
    smartd.startDaemon()
    if smartd.daemonRunning():
        if showPopups:
            xbmc.executebuiltin("Notification(smartmontools, " +
                                addon.getLocalizedString(50001) + ", 7, " +
                                icon + ")")
            # smartd started
    else:
        xbmc.log(consts.logHeader + "failed to start smartd", xbmc.LOGERROR)
        xbmcgui.Dialog().ok(consts.dialogHeader,
                            addon.getLocalizedString(50024))
Ejemplo n.º 6
0
def startService():
    if not sutils.isFileExecutableByOwner(consts.script):
        sutils.addExecPermissions(execDir, True);
        
    smartmontools.checkConfigurationFilesExistance();

    if addon.getSetting(consts.settingDBupdates ) == "true":
        smartmontools.updateDatabase();

    if addon.getSetting(consts.settingRunDaemonOnStartup ) == "true":        
        smartd.startDaemon();
        if smartd.daemonRunning():
            if addon.getSetting(consts.settingSmartdStartupPopup) == True:
                xbmc.executebuiltin("Notification(smartmontools, " + addon.getLocalizedString(50001)+ ", 7, " + icon + ")");  # smartd started
        else:
            xbmc.log(consts.logHeader + "failed to start smartd", xbmc.LOGERROR);
            xbmcgui.Dialog().ok(consts.dialogHeader, addon.getLocalizedString(50024));
Ejemplo n.º 7
0
def listSmartdTasks():
    addFolderItem(
        consts.fontBold + consts.colorBlue +
        addon.getLocalizedString(50012) +  # smartd daemon tasks:
        consts.colorEnd + consts.fontBoldEnd,
        -99)
    if smartd.daemonRunning():
        addFolderItem(addon.getLocalizedString(50013), 3)
        # reload configuration file
        addFolderItem(addon.getLocalizedString(50014), 4)
        # run test now
        addFolderItem(addon.getLocalizedString(50015), 2)
        # stop
    else:
        addFolderItem(addon.getLocalizedString(50016), 1)
        # start

    addFolderItem(addon.getLocalizedString(50017), 5)
Ejemplo n.º 8
0
def startService():
    if not sutils.isFileExecutableByOwner(consts.script):
        sutils.addExecPermissions(execDir, True)

    smartmontools.checkConfigurationFilesExistance()

    if addon.getSetting(consts.settingDBupdates) == "true":
        smartmontools.updateDatabase()

    if addon.getSetting(consts.settingRunDaemonOnStartup) == "true":
        smartd.startDaemon()
        if smartd.daemonRunning():
            if addon.getSetting(consts.settingSmartdStartupPopup) == True:
                xbmc.executebuiltin("Notification(smartmontools, " +
                                    addon.getLocalizedString(50001) + ", 7, " +
                                    icon + ")")
                # smartd started
        else:
            xbmc.log(consts.logHeader + "failed to start smartd",
                     xbmc.LOGERROR)
            xbmcgui.Dialog().ok(consts.dialogHeader,
                                addon.getLocalizedString(50024))