Enhance config_file function to improve MAC address validation by allowing unset variable expansion

This commit is contained in:
Michel Roegl-Brunner 2025-05-16 10:55:18 +02:00
parent 741e2942db
commit 749f22c72b

View File

@ -1186,7 +1186,7 @@ config_file() {
fi
fi
if [[ -n "${MAC}" ]]; then
if [[ -n "${MAC-}" ]]; then
if [[ "$MAC" =~ ^([A-Fa-f0-9]{2}:){5}[A-Fa-f0-9]{2}$ ]]; then
echo -e "${MACADDRESS}${BOLD}${DGN}MAC Address: ${BGN}$MAC${CL}"
MAC=",hwaddr=$MAC"