Browse Source

Fix static mac addr

Julien VAUBOURG 10 years ago
parent
commit
956440e797
2 changed files with 2 additions and 3 deletions
  1. 0 2
      TODO
  2. 2 1
      conf/init_ynh-hotspot

+ 0 - 2
TODO

@@ -8,7 +8,5 @@
 ** WEB: check if ipv6 delgated prefixes and ipv4 nat prefixes are unique
 ** WEB: fix the now broken wifiparty button
 ** INIT: differentiate ipv6 and ipv4 in is_dhcpd_running
-** INIT: do not attribute a static mac address
 ** INIT: use insserv instead of update-rc.d and update service dependencies
-** HARD: try with olimex antenna (no multissid enabled)
 ** MISC: update vpnclient/torclient for enabling the user to choose the correct ssid

+ 2 - 1
conf/init_ynh-hotspot

@@ -142,7 +142,8 @@ start_dhcpd() {
 start_hostapd() {
   cp /etc/hostapd/hostapd.conf{.tpl1,}
 
-  ip link set addr 02:42:42:13:37:00 dev "${ynh_wifi_device}"
+  ethaddr=$(ip link show dev "${ynh_wifi_device}" | grep link/ether | awk -F: '{ printf "02:%s:%s:%s:%s:00", $2, $3, $4, $5 }')
+  ip link set addr "${ethaddr}" dev "${ynh_wifi_device}"
 
   sed "s|<TPL:WIFI_DEVICE>|${ynh_wifi_device}|g" -i /etc/hostapd/hostapd.conf
   sed "s|<TPL:WIFI_CHANNEL>|${ynh_wifi_channel}|g" -i /etc/hostapd/hostapd.conf