Hirdetés

Új hozzászólás Aktív témák

  • daninet

    veterán

    Sziasztok

    Egy scripttel szeretném a noip dns-t frissiteni. A problámám az, hogy egyik interface sem a külső IP-met adja vissza.

    Az ether1 a bemeneti interface de ott sem kapok semmi használhatót.

    Valami ötlet? :R

    Igy nez ki a script:

    # No-IP automatic Dynamic DNS update

    :local noipuser "username"
    :local noippass "password"
    :local noiphost "hostname-kamu.ddns.net"
    :local inetinterface "ether-inet"

    :global currentIP
    :global previousIP

    :if ([/interface get $inetinterface value-name=running]) do={
    :local currentIP [/ip address get [find interface="$inetinterface" disabled=no] address]
    :for i from=( [:len $currentIP] - 1) to=0 do={
    :if ( [:pick $currentIP $i] = "/") do={
    :set currentIP [:pick $currentIP 0 $i]
    }
    }

    :if ($currentIP != $previousIP) do={
    :log info "No-IP Updater: Current IP address $currentIP is not equal to previous IP, update needed"
    :set previousIP $currentIP

    :local url "http://dynupdate.no-ip.com/nic/update\3Fmyip=$currentIP"
    :local noiphostarray
    :set noiphostarray [:toarray $noiphost]
    :foreach host in=$noiphostarray do={
    :log info "No-IP Updater: Sending update for $host"
    /tool fetch url=($url . "&hostname=$host") user=$noipuser password=$noippass mode=http dst-path=("no-ip_ddns_update-" . $host . ".txt")
    :log info "No-IP Updater: Update change requested. Hostname $host will be updated with $currentIP"
    }
    } else={
    :log info "No-IP Updater: Previous IP address $previousIP is equal to current IP, no update needed"
    }
    } else={
    :log info "No-IP Updater: $inetinterface is not currently running, so therefore will not update"
    }

    Miért vegyem meg, ha 3x annyiért, 3x annyi idő alatt megépíthetem? ´¯`·.¸¸.·´¯`·.¸><(((º>

Új hozzászólás Aktív témák