find public interface in /sys/class/net

This commit is contained in:
Peter Hormanns 2023-03-06 12:04:09 +01:00
parent 26fe6414ce
commit ced1f7a00a

View File

@ -238,11 +238,11 @@ public class PacProcessorFactory implements EntityProcessorFactory {
return new CompoundProcessor(
new ShellProcessor("ip addr add "
+ pac.getCurINetAddr().getInet4Addr()
+ "/32 dev eth0"
+ "/32 dev $( ls /sys/class/net/ | egrep -o '(eth0|pub)' )"
),
new ShellProcessor("ip addr add "
+ pac.getCurINetAddr().getInet6Addr()
+ "/128 dev eth0 noprefixroute preferred_lft 0"
+ "/128 dev $( ls /sys/class/net/ | egrep -o '(eth0|pub)' ) noprefixroute preferred_lft 0"
)
);
}
@ -251,11 +251,11 @@ public class PacProcessorFactory implements EntityProcessorFactory {
return new CompoundProcessor(
new ShellProcessor("ip addr del "
+ pac.getCurINetAddr().getInet4Addr()
+ "/32 dev eth0"
+ "/32 dev $( ls /sys/class/net/ | egrep -o '(eth0|pub)' )"
),
new ShellProcessor("ip addr del "
+ pac.getCurINetAddr().getInet6Addr()
+ "/128 dev eth0 noprefixroute preferred_lft 0"
+ "/128 dev $( ls /sys/class/net/ | egrep -o '(eth0|pub)' ) noprefixroute preferred_lft 0"
)
);
}