Manage network on all Linux platforms (#630)

This commit is contained in:
Matt
2022-12-17 23:29:27 -05:00
committed by GitHub
parent bb63af601d
commit 4fd7533456
3 changed files with 5 additions and 3 deletions

View File

@@ -81,11 +81,11 @@ public class NetworkConfig {
@JsonGetter("shouldManage")
public boolean shouldManage() {
return this.shouldManage || Platform.isRaspberryPi();
return this.shouldManage || Platform.isLinux();
}
@JsonSetter("shouldManage")
public void setShouldManage(boolean shouldManage) {
this.shouldManage = shouldManage || Platform.isRaspberryPi();
this.shouldManage = shouldManage || Platform.isLinux();
}
}

View File

@@ -65,6 +65,8 @@ public enum Platform {
public static boolean isLinux() {
return currentPlatform == LINUX_64
|| currentPlatform == LINUX_RASPBIAN
|| currentPlatform == LINUX_AARCH64BIONIC
|| currentPlatform == LINUX_ARM32
|| currentPlatform == LINUX_ARM64;
}

View File

@@ -46,7 +46,7 @@ public class NetworkManager {
var config = ConfigManager.getInstance().getConfig().getNetworkConfig();
logger.info("Setting " + config.connectionType + " with team team " + config.teamNumber);
if (Platform.isRaspberryPi()) {
if (Platform.isLinux()) {
if (!Platform.isRoot) {
logger.error("Cannot manage network without root!");
return;