made edit_ssid.sh path-independent

This commit is contained in:
Kristjan Komlosi
2019-11-11 17:41:55 +01:00
parent 095a95c1eb
commit c72c0800fc

View File

@@ -1,5 +1,6 @@
#!/bin/bash
# edit_ssid.sh - edits hostapd.conf and sets a MAC address-based SSID
cd `dirname $0`
ssid=`ip link | awk '/wlan0/ {getline; print $2}' | awk -v FS=':' '{printf("TeraHz_%s%s%s\n", $4, $5, $6)}'`
sed "/ssid=.*/s/ssid=.*/ssid=$ssid/" hostapd.conf > newconf
mv newconf hostapd.conf