mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-10-26 07:46:35 +01:00
This commit is contained in:
3
.idea/workspace.xml
generated
3
.idea/workspace.xml
generated
@@ -6,6 +6,7 @@
|
||||
<component name="ChangeListManager">
|
||||
<list default="true" id="5251c5c9-f2a1-41f2-bc76-10b517091df1" name="Changes" comment="">
|
||||
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
|
||||
<change beforePath="$PROJECT_DIR$/plogical/installUtilities.py" beforeDir="false" afterPath="$PROJECT_DIR$/plogical/installUtilities.py" afterDir="false" />
|
||||
</list>
|
||||
<option name="SHOW_DIALOG" value="false" />
|
||||
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
||||
@@ -117,7 +118,7 @@
|
||||
<workItem from="1754429757112" duration="3503000" />
|
||||
<workItem from="1754433799097" duration="517000" />
|
||||
<workItem from="1754448353513" duration="2970000" />
|
||||
<workItem from="1754511414251" duration="47027000" />
|
||||
<workItem from="1754511414251" duration="48713000" />
|
||||
</task>
|
||||
<servers />
|
||||
</component>
|
||||
|
||||
@@ -42,11 +42,34 @@ class installUtilities:
|
||||
@staticmethod
|
||||
def addLiteSpeedRepo():
|
||||
try:
|
||||
# Detect OS version to use the correct repository
|
||||
el_version = "7" # Default to el7
|
||||
|
||||
# Check for OS version
|
||||
if os.path.exists('/etc/os-release'):
|
||||
with open('/etc/os-release', 'r') as f:
|
||||
content = f.read()
|
||||
# Check for RHEL/CentOS/AlmaLinux/Rocky 9
|
||||
if 'VERSION_ID="9' in content or 'VERSION_ID=9' in content:
|
||||
el_version = "9"
|
||||
# Check for RHEL/CentOS/AlmaLinux/Rocky 8
|
||||
elif 'VERSION_ID="8' in content or 'VERSION_ID=8' in content:
|
||||
el_version = "8"
|
||||
|
||||
# Use the appropriate repository URL based on version
|
||||
repo_urls = {
|
||||
"7": "http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm",
|
||||
"8": "http://rpms.litespeedtech.com/centos/litespeed-repo-1.3-1.el8.noarch.rpm",
|
||||
"9": "http://rpms.litespeedtech.com/centos/litespeed-repo-1.3-1.el9.noarch.rpm"
|
||||
}
|
||||
|
||||
repo_url = repo_urls.get(el_version, repo_urls["7"])
|
||||
|
||||
cmd = []
|
||||
|
||||
cmd.append("rpm")
|
||||
cmd.append("-ivh")
|
||||
cmd.append("http://rpms.litespeedtech.com/centos/litespeed-repo-1.1-1.el7.noarch.rpm")
|
||||
cmd.append(repo_url)
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
if res == 1:
|
||||
print("###############################################")
|
||||
@@ -76,7 +99,7 @@ class installUtilities:
|
||||
cmd.append("yum")
|
||||
cmd.append("-y")
|
||||
cmd.append("install")
|
||||
cmd.append("openlitespeed-1.4.26")
|
||||
cmd.append("openlitespeed")
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
|
||||
@@ -342,7 +365,7 @@ class installUtilities:
|
||||
cmd.append("yum")
|
||||
cmd.append("-y")
|
||||
cmd.append("remove")
|
||||
cmd.append("openlitespeed-1.4.26")
|
||||
cmd.append("openlitespeed")
|
||||
|
||||
res = subprocess.call(cmd)
|
||||
|
||||
|
||||
Reference in New Issue
Block a user