mirror of
https://github.com/zyphlar/LanternPowerMonitor.git
synced 2024-03-08 14:07:47 +00:00
Allow the pi to be shutdown from the app via bluetooth.
This commit is contained in:
@@ -154,6 +154,14 @@ public class MonitorApp {
|
||||
LOG.error("Exception occurred while trying to reboot", _e);
|
||||
}
|
||||
break;
|
||||
case Shutdown:
|
||||
LOG.info("Shutting down Pi...");
|
||||
try {
|
||||
Runtime.getRuntime().exec(new String[]{"shutdown","now"});
|
||||
} catch (IOException _e) {
|
||||
LOG.error("Exception occurred while trying to shutdown", _e);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user