aboutsummaryrefslogtreecommitdiff
path: root/libLumina/LuminaOS-FreeBSD.cpp
diff options
context:
space:
mode:
authorKen Moore <ken@pcbsd.org>2015-03-02 08:30:52 -0500
committerKen Moore <ken@pcbsd.org>2015-03-02 08:30:52 -0500
commitd84018532345fd43164016867e919f003fcacc04 (patch)
tree5025359698d02caf7d10c9ab46e82bbd2e2d5925 /libLumina/LuminaOS-FreeBSD.cpp
parentUpdate how lumina-open detects applications which are registered on the syste... (diff)
downloadlumina-d84018532345fd43164016867e919f003fcacc04.tar.gz
lumina-d84018532345fd43164016867e919f003fcacc04.tar.bz2
lumina-d84018532345fd43164016867e919f003fcacc04.zip
Disable the shutdown/restart buttons on PC-BSD systems if the system is in the middle of performing updates.
Diffstat (limited to 'libLumina/LuminaOS-FreeBSD.cpp')
-rw-r--r--libLumina/LuminaOS-FreeBSD.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/libLumina/LuminaOS-FreeBSD.cpp b/libLumina/LuminaOS-FreeBSD.cpp
index 8b395026..c58d2397 100644
--- a/libLumina/LuminaOS-FreeBSD.cpp
+++ b/libLumina/LuminaOS-FreeBSD.cpp
@@ -142,7 +142,12 @@ void LOS::startMixerUtility(){
bool LOS::userHasShutdownAccess(){
//User needs to be a part of the operator group to be able to run the shutdown command
QStringList groups = LUtils::getCmdOutput("id -Gn").join(" ").split(" ");
- return groups.contains("operator"); //not implemented yet
+ bool ok = groups.contains("operator"); //not implemented yet
+ if(ok){
+ //If a PC-BSD system, also disable the shutdown/restart options if the system is in the middle of upgrading
+ ok = (QProcess::execute("pgrep -F /tmp/.updateInProgress")!=0); //this is 0 if updating right now
+ }
+ return ok;
}
//System Shutdown
bgstack15