We need this function and the command to identify ports in a nitsi test.
Signed-off-by: Jonatan Schlag <jonatan.schlag@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
print "${device}"
return ${EXIT_OK}
}
+
+device_get_by_mac_address() {
+ local mac=${1}
+
+ assert isset mac
+
+ local device
+
+ for device in $(device_list); do
+ if [ "${mac}" = "$(device_get_address ${device})" ]; then
+ print "${device}"
+ return ${EXIT_OK}
+ fi
+ done
+
+ # We could not found a port to the given mac address so we return exit error
+ return ${EXIT_ERROR}
+}
db-dump)
db_dump
;;
+ device-get-by-mac-address)
+ device_get_by_mac_address "$@"
+ ;;
ipsec-connection-exists)
ipsec_connection_exists "$@"
;;