bash - How can I examine if a computer system feeds on my network WITHOUT IP (i.e. by tool name just)?

I would certainly like my phone to execute particular covering manuscripts using Tasker if my phone gets on the very same wifi network as my laptop. My first suggestion is to modify the /etc/hosts documents, yet this would not function given that neither tool is constricted to be on just one wifi network.

A far more pricey suggestion would certainly be to simply sound every feasible address on the network from my phone, after that effort to send a command using ssh (claim, echo $ANDROID) and also pay attention for the feedback.

The most effective means to do this is to simply have the ability to see if a tool called "myLaptop" feeds on the network. (or, in fact, I can make use of MAC address also.) yet I have no suggestion if this is feasible in bash. Is it?

(I'm additionally open up to executions in Perl, given that I can make use of SL4A to implement Perl manuscripts.)

0
2019-12-02 02:55:17
Source Share
Answers: 4

Dynamic DNS solution would certainly function. Get your laptop computer to upgrade your vibrant domain name with it is neighborhood ip, and afterwards whenever your phone attaches to a new wifi network, settle that domain name, if you get a hit, you are either excellent or took place to locate a person with the very same neighborhood ip!

Comparable to that, you can get your laptop computer to upload it is ip to a web server someplace (internet, email, w/e) that you can fetch from a manuscript on your phone.

Except establishing a DNS web server, I'm not exactly sure there is any kind of methods for settling host names that aren't called in your neighborhood configs.

0
2019-12-03 04:59:54
Source

If you do not desire a server - based remedy, your laptop can pay attention to the network for a details broadcast packet. A program package will certainly be rerouted to every tool in the very same network, yet tools that aren't paying attention to it needs to overlook it.

0
2019-12-03 04:59:23
Source

You can make use of avahi (wiki) (or a comparable item of Zeroconf software program) to uncover computer systems on the network and also release the checklist for your phone to retreive.

See https://stackoverflow.com/questions/1233204/are-there-any-other-java-libraries-for-bonjour-zeroconf-apart-from-jmdns for Java Zeroconf executions.

0
2019-12-03 04:59:17
Source

There is an application called Network Discovery (readily available on F - Droid, might additionally get on the Android Market) that tries to recognize tools on the network your phone is attached to.

As it is Free Software, you can attempt to see if you can change it or make use of sections of it for your objectives.

Not a "here is an APK" solution, yet if you need to write something, it is an excellent start.

Edit : App is below : http://f-droid.org/repository/browse/?fdfilter=network%20discovery&fdid=info.lamatricexiste.network&fdpage=1

0
2019-12-03 04:30:15
Source