Aldebaran has asked for the wisdom of the Perl Monks concerning the following question:
Hello Monks,
We've got Comcast (an american internet service provider) showing up today as I got bumped off twice today for no reason I can ascertain. The service had been spotty, so they recommended getting a new router, which we did. I don't want this "spottiness" to take over my wifi situation and look to the tools I have. Right now, these are mostly bash commands or scripts:
$ cat .bash_aliases alias pt='perltidy -i=2 -utf8 -b ' alias cx='chmod +x ' alias bounce='sudo service network-manager restart ' alias shh="nmcli networking off" alias wake="nmcli networking on" $ shh $ wake $ shh $ wake $
The script I use to show me what's happening with the system journal is:
#!/bin/bash timename=$(date +"%m-%d-%Y_%H-%M-%S") _out_fn=$timename.txt echo "Time is $timename " >> $_out_fn nmcli network off >> $_out_fn nmcli network on >> $_out_fn env | sort >> $_out_fn sleep 40s echo ---journal control--- >> $_out_fn journalctl --since "1 minute ago" >> $_out_fn exit #*******************end**************************
My platform is
$ cat /etc/os-release NAME="Ubuntu" VERSION="18.04.2 LTS (Bionic Beaver)" ID=ubuntu ID_LIKE=debian PRETTY_NAME="Ubuntu 18.04.2 LTS"
, but I seek a solution that can port to strawberry perl (windows) if possible.
I would like to develop a perl-based tool that can discern whether I have a wifi connection that gets me to the internet. There must be any number of ways to do this.
Does one send out a request to some host name, which might be fine, until that host name doesn't want to answer what amounts to a ping?
Part of this software tool that I want to have would also tell me when the wireless goes out in a log. For this machine, I think I would grep events in journalctl. Might it be able to run as a daemon?It might retry the connection every minute or so.
I hope that we can work up a few solutions to compare and contrast. Thanks for your comment.
|
---|