mirror of
https://github.com/aaPanel/aaPanel.git
synced 2026-09-28 12:24:50 +02:00
update 6.5.1
This commit is contained in:
+10
-9
@@ -280,7 +280,7 @@ class system:
|
||||
c_tmp = public.readFile('/proc/cpuinfo')
|
||||
d_tmp = re.findall("physical id.+",c_tmp)
|
||||
cpuW = len(set(d_tmp))
|
||||
used = self.get_cpu_percent()
|
||||
used = psutil.cpu_percent(1)
|
||||
used_all = psutil.cpu_percent(percpu=True)
|
||||
cpu_name = public.getCpuType() + " * {}".format(cpuW)
|
||||
return used,cpuCount,used_all,cpu_name,cpuNum,cpuW
|
||||
@@ -362,8 +362,9 @@ class system:
|
||||
if len(disk) < 5: continue;
|
||||
if disk[1].find('M') != -1: continue;
|
||||
if disk[1].find('K') != -1: continue;
|
||||
if len(disk[5].split('/')) > 4: continue;
|
||||
if len(disk[5].split('/')) > 10: continue;
|
||||
if disk[5] in cuts: continue;
|
||||
if disk[5].find('docker') != -1: continue
|
||||
arr = {}
|
||||
arr['path'] = disk[5];
|
||||
tmp1 = [disk[1],disk[2],disk[3],disk[4]];
|
||||
@@ -433,7 +434,7 @@ class system:
|
||||
public.serviceReload();
|
||||
filename = '/www/server/nginx/off'
|
||||
if os.path.exists(filename): os.remove(filename)
|
||||
os.system('echo > /tmp/panelBoot.pl');
|
||||
public.ExecShell('echo > /tmp/panelBoot.pl');
|
||||
return total,count
|
||||
|
||||
def GetNetWork(self,get=None):
|
||||
@@ -671,14 +672,14 @@ class system:
|
||||
#执行
|
||||
execStr = "/etc/init.d/"+get.name+" "+get.type
|
||||
if execStr == '/etc/init.d/pure-ftpd reload': execStr = self.setupPath+'/pure-ftpd/bin/pure-pw mkdb '+self.setupPath+'/pure-ftpd/etc/pureftpd.pdb'
|
||||
if execStr == '/etc/init.d/pure-ftpd start': os.system('pkill -9 pure-ftpd');
|
||||
if execStr == '/etc/init.d/pure-ftpd start': public.ExecShell('pkill -9 pure-ftpd');
|
||||
if execStr == '/etc/init.d/tomcat reload': execStr = '/etc/init.d/tomcat stop && /etc/init.d/tomcat start';
|
||||
if execStr == '/etc/init.d/tomcat restart': execStr = '/etc/init.d/tomcat stop && /etc/init.d/tomcat start';
|
||||
|
||||
if get.name != 'mysqld':
|
||||
result = public.ExecShell(execStr);
|
||||
else:
|
||||
os.system(execStr);
|
||||
public.ExecShell(execStr);
|
||||
result = [];
|
||||
result.append('');
|
||||
result.append('');
|
||||
@@ -705,7 +706,7 @@ class system:
|
||||
|
||||
#释放内存
|
||||
def ReMemory(self,get):
|
||||
os.system('sync');
|
||||
public.ExecShell('sync');
|
||||
scriptFile = 'script/rememory.sh'
|
||||
if not os.path.exists(scriptFile):
|
||||
public.downloadFile(public.GetConfigValue('home') + '/script/rememory.sh',scriptFile);
|
||||
@@ -717,7 +718,7 @@ class system:
|
||||
#s = time.time()
|
||||
#if not self.shell: self.connect_ssh()
|
||||
#self.shell.send("nohup /etc/init.d/bt restart && sleep 1 && /etc/init.d/bt start > /dev/null &\n")
|
||||
#os.system("nohup sleep 2 && /etc/init.d/bt restart 2>&1 >/dev/null &")
|
||||
#public.ExecShell("nohup sleep 2 && /etc/init.d/bt restart 2>&1 >/dev/null &")
|
||||
|
||||
public.ExecShell("/etc/init.d/bt start")
|
||||
public.writeFile('data/restart.pl','True')
|
||||
@@ -749,13 +750,13 @@ class system:
|
||||
|
||||
#修复面板
|
||||
def RepPanel(self,get):
|
||||
os.system("wget -O update.sh " + public.get_url() + "/install/update6_en.sh && bash update.sh");
|
||||
public.ExecShell("wget -O update.sh " + public.get_url() + "/install/update6_en.sh && bash update.sh");
|
||||
self.ReWeb(None)
|
||||
return True;
|
||||
|
||||
#升级到专业版
|
||||
def UpdatePro(self,get):
|
||||
os.system("wget -O update.sh " + public.get_url() + "/install/update6_en.sh && bash update.sh");
|
||||
public.ExecShell("wget -O update.sh " + public.get_url() + "/install/update6_en.sh && bash update.sh");
|
||||
self.ReWeb(None)
|
||||
return True;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user