Update WebBackend.cpp

Fix the sysadm/pkg API class detection method to account for the new location of the "pkg" binary on TrueOS 18.06
Also fix the sysadm/update API class to look for the "trueos-update" utility.
This commit is contained in:
Ken Moore
2018-09-01 06:31:49 -04:00
committed by GitHub
parent aab6f484ef
commit 0fdcdb2c9b

View File

@@ -77,7 +77,7 @@ RestOutputStruct::ExitCode WebSocket::AvailableSubsystems(bool allaccess, QJsonO
}
// - pkg
if(QFile::exists("/usr/local/sbin/pkg")){
if(QFile::exists("/usr/local/sbin/pkg") || QFile::exists("/usr/sbin/pkg")){
out->insert("sysadm/pkg", "read/write");
}
@@ -85,7 +85,7 @@ RestOutputStruct::ExitCode WebSocket::AvailableSubsystems(bool allaccess, QJsonO
out->insert("sysadm/systemmanager","read/write");
// - PC-BSD/TrueOS Updater
if(QFile::exists("/usr/local/bin/pc-updatemanager")){
if(QFile::exists("/usr/local/bin/pc-updatemanager") || QFile::exists("/usr/sbin/trueos-update")){
out->insert("sysadm/update", "read/write");
}