I have a small issue with my Belkin USB Wifi (model: F7D1101). I have to continuously restart netctl till it connects to my wifi. So I want to create a small python script which would check the following in an ordered way:
1) Check if the wifi dongle is connected to a USB port. If it isn't, abort.
2) Check if the wifi profile is present in /etc/netctl/ . If not then abort.
3) Start a loop which would call netctl using "popen". The loop will continue till the router is 'ping-able'.
4) As soon as the router returns a packet, stop all processes called by popen and exit with status 0
I have tried my best to explain the algorithm in short. I am thinking of using Python2.7, ping, usbid and popen to reach the goal.
I just want to know if my approach is feasible or is there a better way to do it.
And yes I am using Arch Linux ARM.
Thanking in advance.
Abhinav