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.


In reply to writing a utility to determine whether I have a working wifi connection by Aldebaran

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.