<html>
  <head>
    <meta content="text/html; charset=windows-1252"
      http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    <p><font size="-1">Johan,</font></p>
    <p><font size="-1">If your internet connection is going up and down
        regularly, you may be better off executing your test from a
        timer route:</font></p>
    <p><font size="-1">timer_route[internet_check, 300] {<br>
            #
        -----------------------------------------------------------------<br>
            # Timer Route every 5 minutes<br>
            #
        -----------------------------------------------------------------<br>
        <br>
           exec("/usr/local/bin/some_check _script");<br>
        }<br>
        <br>
      </font></p>
    <p><font size="-1">There are many different ways to check if you
        have an internet connection, the way you do it will depend on
        your environment and application, but here is a very simple
        shell script as an example:</font></p>
    <p><font size="-1">#!/bin/bash<br>
        ping -c 2 8.8.8.8 &gt; /dev/null<br>
        if [ $? -eq 0 ]; then<br>
        echo "Internet Alive $(date)";<br>
        else<br>
        echo "Internet Dead $(date)";<br>
        fi</font><br>
    </p>
    <div class="moz-signature"><font size="-1"><font face="Verdana">Kind
          regards,<br>
          <br>
          Adrian Fretwell<br>
        </font></font><small><small><small><font face="Verdana"></font></small></small></small>
    </div>
    <div class="moz-cite-prefix"><br>
      On 08/08/16 07:58, Johan De Clercq wrote:<br>
    </div>
    <blockquote
cite="mid:CAEVWGm8EwO=6zr7GzNzuDK4EDBTt8e-1c6FyO_qRC=fUYgaZ5A@mail.gmail.com"
      type="cite">
      <div dir="ltr">create a start up route startup_route, the use
        module exec to f.e. get your pub ip with curl.  <br>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">2016-08-04 15:21 GMT+02:00 Rodrigo
          Pimenta Carvalho <span dir="ltr">&lt;<a
              moz-do-not-send="true" href="mailto:pimenta@inatel.br"
              target="_blank">pimenta@inatel.br</a>&gt;</span>:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">
              <div
style="font-size:12pt;color:#000000;background-color:#ffffff;font-family:Calibri,Arial,Helvetica,sans-serif">
                <p>Hi.</p>
                <p><br>
                </p>
                <p>How to discover if OpenSIPS is connected do Internet,
                  from its configuration script?</p>
                <p><br>
                </p>
                <p>Sometimes the Internet Link is down and then just
                  local calls will work. If I can discover if OpenSIPS
                  is "online" on Internet, I will use this information
                  to implement some specific logic in my script.<br>
                </p>
                <p><br>
                </p>
                <p>Best regards.<span class="HOEnZb"><font
                      color="#888888"><br>
                    </font></span></p>
                <span class="HOEnZb"><font color="#888888">
                    <p><br>
                    </p>
                    <div>
                      <div name="divtagdefaultwrapper">
                        <div><font size="2">
                            <div>RODRIGO PIMENTA CARVALHO<br>
                              Inatel Competence Center<br>
                              Software<br>
                              Ph: <a moz-do-not-send="true"
                                href="tel:%2B55%2035%203471%209200"
                                value="+553534719200" target="_blank">+55
                                35 3471 9200</a> RAMAL 979<br>
                            </div>
                          </font></div>
                      </div>
                    </div>
                  </font></span></div>
            </div>
            <br>
            ______________________________<wbr>_________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              rel="noreferrer" target="_blank">http://lists.opensips.org/cgi-<wbr>bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
      <br>
      <fieldset class="mimeAttachmentHeader"></fieldset>
      <br>
      <pre wrap="">_______________________________________________
Users mailing list
<a class="moz-txt-link-abbreviated" href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a>
<a class="moz-txt-link-freetext" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
    </blockquote>
    <br>
  </body>
</html>