X-Git-Url: http://git.grml.org/?a=blobdiff_plain;f=sbin%2Fnetcardconfig;h=41f08c98b23f66931d35cb3844589c71c83d9909;hb=870cd136ab01194ca24b841a6be2cf2c35081bd7;hp=f57552b3594fbcfda9d48b77fb3194ce7c8826f2;hpb=eebbac24ec6479c6c88593892f7d1616b91ccc19;p=grml-network.git diff --git a/sbin/netcardconfig b/sbin/netcardconfig index f57552b..41f08c9 100755 --- a/sbin/netcardconfig +++ b/sbin/netcardconfig @@ -683,7 +683,20 @@ while (true); do $DIALOG --menu "$MESSAGE1" 18 60 12 "${DEVICELIST[@]}" "${EXITMENU[@]}" 2>"$TMP" || bailout read -r DV <"$TMP" ; rm -f "$TMP" else - DV="${NET_DEV}" + # we have interface name so we need to find its number in NETDEVICES + DV=0 + found=false + for DV in "${!NETDEVICES[@]}"; do + if [[ "${NETDEVICES[$DV]}" =~ ^"${NET_DEV} " ]]; then + found=true + break + fi + done + if ! "${found}"; then + echo "There is no interface ${NET_DEV} in the system" >&2 + bailout 1 + fi + [[ -z "${IFACEDONE}" ]] || bailout fi [ "$DV" = "$EXITKEY" ] && bailout