mirror of
https://github.com/PhotonVision/photonvision
synced 2026-06-22 01:11:40 +00:00
V2.3.1- bug fix
* Fix linux networking * better general settings message * bug fix general settings networking not returning correct status * updated pom
This commit is contained in:
@@ -71,9 +71,10 @@ public class LinuxNetworking extends SysNetworking {
|
||||
lines.add("interface " + networkInterface.name);
|
||||
InetAddress iNetMask = InetAddress.getByName(netmask);
|
||||
int prefix = NetmaskToCIDR.convertNetmaskToCIDR(iNetMask);
|
||||
lines.add("static ip_address " + ipAddress + "/" + prefix);
|
||||
lines.add("static routers " + gateway);
|
||||
lines.add("static ip_address=" + ipAddress + "/" + prefix);
|
||||
lines.add("static routers=" + gateway);
|
||||
FileUtils.writeLines(dhcpConf, lines);
|
||||
return true;
|
||||
} catch (IOException e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
|
||||
@@ -57,8 +57,8 @@ public class RequestHandler {
|
||||
// setting up network config after saving
|
||||
boolean isStatic = ConfigManager.settings.connectionType.equals(NetworkIPMode.STATIC);
|
||||
|
||||
if (NetworkManager.setHostname(ConfigManager.settings.hostname) &&
|
||||
NetworkManager.setNetwork(isStatic, ConfigManager.settings.ip, ConfigManager.settings.netmask, ConfigManager.settings.gateway)) {
|
||||
boolean state = NetworkManager.setHostname(ConfigManager.settings.hostname) && NetworkManager.setNetwork(isStatic, ConfigManager.settings.ip, ConfigManager.settings.netmask, ConfigManager.settings.gateway);
|
||||
if (state) {
|
||||
ctx.status(200);
|
||||
} else {
|
||||
ctx.result("Something went wrong while setting network configuration");
|
||||
|
||||
Reference in New Issue
Block a user