20-set-ssid 550 B

1234567891011121314151617181920
  1. if [ $(cat /tmp/sysinfo/board_name) == 'tl-wr710n' ]; then
  2. ## tl-wr710n has three last pairs as MAC
  3. _MAC=$(iw wlan0 info | awk 'BEGIN { FS=":" } /addr/ { print substr(toupper($4$5$6),1) }')
  4. else
  5. ## others have only two
  6. _MAC=$(iw wlan0 info | awk 'BEGIN { FS=":" } /addr/ { print substr(toupper($5$6),1) }')
  7. fi
  8. _MAC="Superglue-"$_MAC
  9. [ $(uci get wireless.@wifi-iface[0].ssid) != $_MAC ] && (
  10. uci set wireless.@wifi-iface[0].ssid=$_MAC
  11. uci commit wireless
  12. wifi
  13. /etc/init.d/network restart
  14. /etc/init.d/dnsmasq restart
  15. )
  16. exit 0