Status LAN incorrect

Einklappen
X
 
  • Zeit
  • Anzeigen
Alles löschen
neue Beiträge
  • madito
    Extension Master
    • 03.07.2017
    • 130

    Status LAN incorrect

    Hi!

    The state of the LAN is incorrect, the IP is OK and show bad in the status (image 1).

    Looking in the code I found (on file /opt/music_server/mstools):

    wget -q --tries=3 --timeout=5 --spider $gateway

    The result is $? is 1 but the if is executed before this check finish (i think), this always show LAN=0.

    I have commented the line and the result is OK (image 2).

    Thanks for your work!!

  • hismastersvoice
    Supermoderator
    • 25.08.2015
    • 7238

    #2
    If you get get failed the Gateway dont answer, if you commented this line it allway say yes, but thats not the truth.
    So you have to look if the Gateway you have set is answer the ping.

    From my side there is no issue.

    Try so set the timeout higher so see if the answer isn´t to solw.

    Kein Support per PN!

    Kommentar

    • madito
      Extension Master
      • 03.07.2017
      • 130

      #3
      Hi!

      The gateway is get,but the if no entry correctly:

      root@music-server:~# /sbin/ip route | awk '/default/ { print $3 }'
      192.168.1.1

      I make this modifications:

      gateway=$(/sbin/ip route | awk '/default/ { print $3 }')
      wget -q --tries=3 --timeout=10 --spider $gateway
      if [[ $? -eq 0 ]]; then
      echo "LAN"="1" >> /tmp/status.txt
      else
      echo "LAN"="0 $?" >> /tmp/status.txt
      fi

      The results:

      WAN="1"
      LAN="0 1"

      Kommentar

      Lädt...