Allow JAR update/restart on all linux platforms (#651)

* Added linux support

* Changed to just check linux
This commit is contained in:
Mohammad Durrani
2022-12-26 21:40:36 -05:00
committed by GitHub
parent 1971744589
commit 548f52e117
2 changed files with 4 additions and 4 deletions

View File

@@ -113,7 +113,7 @@ public class RequestHandler {
logger.info("New .jar uploaded successfully.");
if (file != null) {
if (Platform.isRaspberryPi()) {
if (Platform.isLinux()) {
try {
Path filePath =
Paths.get(ProgramDirectoryUtilities.getProgramDirectory(), "photonvision.jar");
@@ -140,7 +140,7 @@ public class RequestHandler {
}
} else {
logger.error("Hot .jar replace currently only supported on Raspberry pi. Ignoring.");
logger.error("Hot .jar replace currently only supported on Linux. Ignoring.");
ctx.status(500);
}
@@ -233,7 +233,7 @@ public class RequestHandler {
* an equivalent.
*/
public static void restartProgramInternal() {
if (Platform.isRaspberryPi()) {
if (Platform.isLinux()) {
try {
new ShellExec().executeBashCommand("systemctl restart photonvision.service");
} catch (IOException e) {