Commit 1965a0a1 authored by Dorian Zedler's avatar Dorian Zedler

added ability to reboot the host by calling qApp->exit(1020);

parent 2a82adac
#include <QCoreApplication>
#include <QProcess>
#include "headers/mainactivity.h"
int main(int argc, char *argv[])
......@@ -22,5 +23,15 @@ int main(int argc, char *argv[])
qDebug() << "end: " << currentExitCode << "\n---------------------------------------------\n";
if(currentExitCode == 1020) {
// a reboot of the host was requested
QProcess rebootProcess;
rebootProcess.start("sudo reboot now");
QEventLoop rebootWaitLoop;
QObject::connect(&rebootProcess, SIGNAL(finished), &rebootWaitLoop, SLOT(quit));
return currentExitCode;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment