- log DEBUG "Could not find an existing port configuration for '${INTERFACE}'."
- log DEBUG "${INTERFACE} --> ${port}"
- ;;
-esac
+ # If no port configuration could be found,
+ # we search for the next unused name and return that.
+ port=$(port_find_free ${PORT_PATTERN})
+ echo "${port}"
+
+ log DEBUG "Could not find an existing port configuration for '${INTERFACE}'"
+ log DEBUG "Renaming interface '${INTERFACE}' to '${port}'"
+ ;;
+ esac
+
+ return ${EXIT_OK}
+}