Check if wifi disconnected-> create adhoc (Linux)

2

I'm searching for a possibility to make my linux check periodically if there is wifi network connected. If there is no connection, an adhoc network should be created.

Marcel Glab

Posted 2015-10-26T22:37:40.503

Reputation: 23

Maybe a script that runs every X minutes (maybe with do ... until sleep X, or scheduled elsewhere to run every X minutes), pings your router or always-up site, and if ping fails then setup adhoc network? Or instead of ping, maybe ifquery? – Xen2050 – 2015-10-27T00:27:07.143

That works great. Thanks. But now I am having another problem: If I connect to the AdHoc network with for example my tablet, I'm not getting an IP address. Because of this I can not use SSH. – Marcel Glab – 2015-10-28T01:28:27.373

Answers

0

Maybe a script, bash or other, that runs every X minutes (maybe with do ... until sleep X, or scheduled elsewhere to run every X minutes), pings your router or some always-up site, and if ping fails then setup an adhoc network? Or instead of ping, maybe ifquery? But ping can fail even when the interace is "up".

I'm not sure about why your tablet's not getting an IP address, maybe DHCP isn't activating correctly, setting a manual/fixed IP & settings should work though.

(Comment to answer)

Xen2050

Posted 2015-10-26T22:37:40.503

Reputation: 12 097