The interface extraction line has always a 0 exit code because of the cut commands.
This creates problems when not matching interfaces come up, such as network.interface.loopback. In this case $interface will be an empty string but the [ $? = 0 ] test will succeed. In turn register_hook is called with empty interface which exits with exit 1.
The interface extraction line has always a
0
exit code because of thecut
commands.This creates problems when not matching interfaces come up, such as
network.interface.loopback
. In this case$interface
will be an empty string but the[ $? = 0 ]
test will succeed. In turnregister_hook
is called with empty interface which exits withexit 1
.Adding a
test
for$interface
fixes the problem.