From 1eb11077d356898310e139676fdadb8020de941f Mon Sep 17 00:00:00 2001 From: oblique Date: Sat, 20 Sep 2014 22:59:40 +0300 Subject: [PATCH] Change the mac address of the virtual interface if another interface has the same --- create_ap | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/create_ap b/create_ap index 2e565ce..cf550c7 100755 --- a/create_ap +++ b/create_ap @@ -714,7 +714,9 @@ if [[ $NO_VIRT -eq 0 ]]; then die "$VIRTDIEMSG" fi OLD_MACADDR=$(get_macaddr ${VWIFI_IFACE}) - [[ ${OLD_MACADDR} == $(get_macaddr ${WIFI_IFACE}) ]] && NEW_MACADDR=$(get_new_macaddr ${VWIFI_IFACE}) + if [[ $(get_all_macaddrs | grep -c ${OLD_MACADDR}) -ne 1 ]]; then + NEW_MACADDR=$(get_new_macaddr ${VWIFI_IFACE}) + fi WIFI_IFACE=${VWIFI_IFACE} fi