You can identify the interface used with this command (run as root) :
iwconfig 2>/dev/null | grep -o "^\w*"
and the output will be, for example :
wlan0
You have to save the answer in a variable in your script
You can identify the interface used with this command (run as root) :
iwconfig 2>/dev/null | grep -o "^\w*"
and the output will be, for example :
wlan0
You have to save the answer in a variable in your script