i wrote a udev rule and placed it in /etc/udev/rules/90-wifi.rules
ACTION=="add", SUBSYSTEM=="usb", DRIVER=="usb", RUN+="sh /usr/local/bin/setup_wifi_wrapper.sh"
It should run on every inserted usb device.
It should start the script /usr/local/bin/setup_wifi_wrapper.sh
#!/bin/bash /usr/local/bin/start_wifi.sh & disown
And that should start /usr/local/bin/start_wifi.sh
#!/bin/bash sudo systemctl start hostapd sudo ifup br0 sudo systemctl restart dnsmasq touch /home/user/started
But it does not... The scripts are all executable and I can start them from command line and they do what they are supposed to do. I tried having them in differente locations, started in the home folder moved them to usr/local/bin. Made the wrapper with disown for background processes but still no results. Does anybody have an idea?
Thanks in advance