P
P
PenguiN5602014-10-15 19:10:02
linux
PenguiN560, 2014-10-15 19:10:02

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

4 answer(s)
M
Maxim, 2014-10-15
@maxpointn2point

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

B
brutal_lobster, 2014-10-16
@brutal_lobster

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.

R
Roman Belyaev, 2015-02-08
@exclus

Sergey Dzheygalo has smartliving.ru , this script works just via bluetooth, you can look at it.
smartliving.ru/Main/ModuleBtdevices

H
hobbyte, 2015-03-14
@hobbyte

on the example of bluetoothmotion

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question