mirror of
https://github.com/PhotonVision/photonvision
synced 2026-07-05 03:21:40 +00:00
Manage network on all Linux platforms (#630)
This commit is contained in:
@@ -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();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user