#!/bin/sh
. /lib/netifd/netifd-wireless.sh
. /lib/netifd/hostapd.sh
+. /lib/functions/system.sh
init_wireless_driver "$@"
json_select ..
- [ -n "$macaddr" ] || {
+ if [ -z "$macaddr" ]; then
macaddr="$(mac80211_generate_mac $phy)"
macidx="$(($macidx + 1))"
- }
+ elif [ "$macaddr" = 'random' ]; then
+ macaddr="$(macaddr_random)"
+ fi
json_add_object data
json_add_string ifname "$ifname"