mirror of
https://github.com/outbackdingo/sysadm.git
synced 2026-01-27 02:20:17 +00:00
Merge branch 'master' of github.com:trueos/sysadm
This commit is contained in:
@@ -148,8 +148,7 @@ bool Firewall::IsRunning()
|
||||
}
|
||||
|
||||
bool Firewall::IsEnabled(){
|
||||
ServiceManager serviceManager;
|
||||
return serviceManager.isEnabled( serviceManager.GetService("ipfw") );
|
||||
return (0 == system("sysrc -c firewall_enable=\"YES\"") );
|
||||
}
|
||||
|
||||
void Firewall::Start()
|
||||
@@ -256,10 +255,9 @@ void Firewall::SaveOpenPorts(QList<PortInfo> openports)
|
||||
file.close();
|
||||
}
|
||||
//Re-load/start rules (just in case - it is a smart script)
|
||||
if(IsRunning())
|
||||
{
|
||||
QStringList args;
|
||||
if(IsRunning()){ Restart(); }
|
||||
/* QStringList args;
|
||||
args << "/usr/local/share/pcbsd/scripts/reset-firewall";
|
||||
General::RunCommand("sh",args);
|
||||
}
|
||||
}*/
|
||||
}
|
||||
|
||||
@@ -257,7 +257,7 @@ QJsonObject SysMgmt::memoryStats() {
|
||||
QJsonObject SysMgmt::procInfo() {
|
||||
QJsonObject retObject;
|
||||
QStringList output;
|
||||
output = General::RunCommand("top -t -n all").split("\n");
|
||||
output = General::RunCommand("top -t -n -a all").split("\n");
|
||||
bool inSection = false;
|
||||
for(int i=0; i<output.length(); i++){
|
||||
if (output.at(i).contains("PID") && output.at(i).contains("USERNAME")){
|
||||
@@ -283,7 +283,7 @@ QJsonObject SysMgmt::procInfo() {
|
||||
values.insert("cpu", line.section(" ", 8, 8));
|
||||
values.insert("time", line.section(" ", 9, 9));
|
||||
values.insert("wcpu", line.section(" ", 10, 10));
|
||||
values.insert("command", line.section(" ", 11, 11));
|
||||
values.insert("command", line.section(" ", 11, -1));
|
||||
|
||||
// Add the PID object
|
||||
retObject.insert(pid, values);
|
||||
|
||||
Reference in New Issue
Block a user