Change to IF

Forums Desktop Info Change to IF

This topic contains 5 replies, has 2 voices, and was last updated by Glenn Glenn 1 month, 2 weeks ago.

  • Author
    Posts
  • #2048 Reply
    Avatar
    Nathan K.

    Hi Glenn,

    Not sure if something changed, but my IF that I use in conjunction with SET and HTTPGET isn’t working the way it used to. I wrote a little block to display the WAN address (both IPv4 and IPv6), and if one or the other doesn’t return an expected value it’s supposed to replace the output with “<n/a>”, but it’s not working after the 1.18 update.

    
    ### Display WAN Address (IPv4 and IPv6 if available) ###
    HTTPGET=active:1,interval:600,set:wan_ipv4,source:http://ipecho.net/plain/,display:%1,hidden:1
    IF=active:1,value1:%wan_ipv4%,value2:.,comparator:notcontains
    TEXT=active:1,set:wan_ipv4,display:<n/a>,hidden:1
    HTTPGET=active:1,interval:600,set:wan_ipv6,source:http://plain-text-ip.com/,display:%1,hidden:1
    IF=active:1,value1:%wan_ipv6%,value2::,comparator:notcontains
    TEXT=active:1,set:wan_ipv6,display:<n/a>,hidden:1
    TEXT=active:1,interval:60,color:55cc77,text:WAN Address,display:IPv4: %wan_ipv4%   IPv6: %wan_ipv6%
    

    Here at my office, we don’t use IPv6, so I should get the following

    WAN Address IPv4: x.x.x.x IPv6: <n/a>

    but instead, I’m getting this

    WAN Address IPv4: x.x.x.x IPv6: x.x.x.x <—- IPv4 address

    Thoughts?

    0
  • #2049 Reply
    Glenn
    Glenn
    Keymaster

    plain-text-ip.com seems to be reporting ipv4, perhaps. I can’t tell because my isp doesn’t do ipv6. When i test your code here, I get the expected display.

    • This reply was modified 1 month, 2 weeks ago by Glenn Glenn.
    • This reply was modified 1 month, 2 weeks ago by Glenn Glenn.
    • This reply was modified 1 month, 2 weeks ago by Glenn Glenn.
    0
  • #2054 Reply
    Avatar
    Nathan K.

    plain-text-ip.com reports IPv6 if found, otherwise reports IPv4. That is partly why I decided to right this block of code. Either way, the code block should show <n/a> for the IPv6 address for you, and not the IPv4 address.

    0
  • #2056 Reply
    Glenn
    Glenn
    Keymaster

    I just saw it. Before I had a chance to do anything about it, it reverted back to <n/a>.

    • This reply was modified 1 month, 2 weeks ago by Glenn Glenn.
    0
  • #2061 Reply
    Avatar
    Nathan K.

    I’ve only seen it come up once or twice.. not sure if it’s just a glitch, or something in the way you changed SET, or what.

    0
  • #2064 Reply
    Glenn
    Glenn
    Keymaster

    I suspect plain-text-ip.com occasionally gives an unexpected response. I’ve been monitoring it now for 2 days and haven’t seen it again.

    1+
Reply To: Change to IF
Your information:




Cancel
Do NOT follow this link or you will be banned from the site!