Answer the question
In order to leave comments, you need to log in
How to run a script when a phone appears in range of wireless networks?
Good day. I wondered how to make it so that when a certain bluetooth device (phone) appears, run some script on a laptop? OS: GNU/Linux Gentoo ~amd64.
For example, I return home, and the laptop already welcomes me (and all my neighbors) by finding my phone and running my favorite tune. Options for detecting by ip in the home wifi network, or by the name of the access point on the phone are also considered. Do I understand correctly that I will have to hang up the job in cron and parse the output of the corresponding commands every 5-10 seconds, or are there other methods?
Answer the question
In order to leave comments, you need to log in
or maybe let the phone send a message to the server when a connection appears, and there the server already starts what is needed
somehow like this
Have a look at udev-rules
www.reactivated.net/writing_udev_rules.html#extern...
Just pay attention to
systemd, by the way, also knows how to depend on a specific device in a unit - through ENV (SYSTEMD_WANTS) or AFTER.
Sergey Dzheygalo has smartliving.ru , this script works just via bluetooth, you can look at it.
smartliving.ru/Main/ModuleBtdevices
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question