try pac ip update

This commit is contained in:
Peter Hormanns 2022-07-29 14:17:53 +02:00
parent c308720e84
commit bc4b6a4965

View File

@ -130,6 +130,16 @@ public class PacModuleImpl extends AbstractModuleImpl {
Pac newState = (Pac) entity;
EntityManager em = getTransaction().getEntityManager();
Pac oldState = em.find(Pac.class, newState.getId());
String oldCurINetAddr = oldState.getCurINetAddr().getInet4Addr();
String newCurINetAddr = newState.getCurINetAddr().getInet4Addr();
System.out.println("new IP: " + newCurINetAddr);
System.out.println("old IP: " + oldCurINetAddr);
if (newCurINetAddr != null && !newCurINetAddr.isEmpty() && !newCurINetAddr.equals(oldCurINetAddr)) {
System.out.println("needs IP update");
}
String oldBasepacName = oldState.getBasepac().getName();
BasePac newBasepac = newState.getBasepac();
String newBasepacName = newBasepac.getName();