Running script when wifi device connects
by cosmarchy from LinuxQuestions.org on (#5Q9Y5)
Hi,
I'm looking for a solution which will run a script when a specific device connects to a wifi network.
I have a mobile wifi device which is connected to a battery with a limited run time. When the mobile device is in range of my network, I need to trigger a script to download the information from that device to a NAS. The question is more to do with how to trigger the script rather than what the script will do.
Since I cannot see any way of triggering an event on my router when the mobile device connects to it, I was wondering whether this is possible by using a device such as a RaspberryPI as a hotspot, which the mobile device would connect to, thus triggering a script and triggering the download.
Whilst a RaspberryPi is not the only hardware which can be used a hotspot, I'm guessing that if this is possible, it is more of a software or rather Linux question than it is a hardware problem as Linux will run on multiple platforms...
I cannot rely on a polling type setup, where the hotspot device polls for the mobile device at set intervals, as the mobile device comes in to range of the wifi and connects as different times of the day and I need to trigger the download as soon as possible after connecting to ensure the download completes before the battery runs out...
Is this possible to do this?
Thanks
I'm looking for a solution which will run a script when a specific device connects to a wifi network.
I have a mobile wifi device which is connected to a battery with a limited run time. When the mobile device is in range of my network, I need to trigger a script to download the information from that device to a NAS. The question is more to do with how to trigger the script rather than what the script will do.
Since I cannot see any way of triggering an event on my router when the mobile device connects to it, I was wondering whether this is possible by using a device such as a RaspberryPI as a hotspot, which the mobile device would connect to, thus triggering a script and triggering the download.
Whilst a RaspberryPi is not the only hardware which can be used a hotspot, I'm guessing that if this is possible, it is more of a software or rather Linux question than it is a hardware problem as Linux will run on multiple platforms...
I cannot rely on a polling type setup, where the hotspot device polls for the mobile device at set intervals, as the mobile device comes in to range of the wifi and connects as different times of the day and I need to trigger the download as soon as possible after connecting to ensure the download completes before the battery runs out...
Is this possible to do this?
Thanks