Olá Pessoal!
Tive muita dificuldade em encontrar esse script para o Provedor DTDNS e só encontrei em um site Chinês. Traduzi e estou disponibilizando a todos.
Um forte abraço.
Código :# Definir definições relacionadas ao DtDNS, a seguir auto-modificar: #============================================================ :local DDNSUser "Usuário DTDNS" :local DDNSPassword "Senha DTDNS" :local DDNSHost "Endereço do Seu Domínio DTDNS" :local DDNSInterface "Interface PPPoE" #============================================================ # Se o seguinte programa não entender, é recomendável não modificar: #------------------------------------------------------------------------------------------ # Definir variáveis de IP :local DDNSIP :global DDNSLastIP # Definir padrões de variáveis :if ([ :typeof $DDNSLastIP ] = nil ) do={ $DDNSLastIP "0.0.0.0" } # Obter o endereço IP da interface da web :set DDNSIP [ /ip address get [/ip address find interface=$DDNSInterface ] address ] :set DDNSIP [ :pick $DDNSIP 0 [ :find $DDNSIP "/" ] ] # Determine se deseja atualizar o IP :if ([ :typeof $DDNSIP ] = nil ) do={ :log error ("DDNS DtDNS: Interface de rede " . $DDNSInterface . " Endereço IP não obtido") } else={ :if ($DDNSIP != $DDNSLastIP) do={ # IP DDNS atualizado :local url "http://www.dtdns.com/api/autodns.cfm?id=$DDNSHost&pw=$DDNSPassword&ip=$DDNSIP" /tool fetch url="$url" mode=http dst-path=("DDNS_DtDNS_$DDNSInterface") :delay 1 # Conteúdo do arquivo :local filestr [ /file get "DDNS_DtDNS_$DDNSInterface" contents]; # Exclua o arquivo :local filename [ /file find name="DDNS_DtDNS_$DDNSInterface"]; /file remove $filename # Se a mudança foi bem sucedida :if ( [ :find $filestr "$DDNSIP"] > 0 ) do={ :log warning ("DDNS DtDNS: Interface de rede " . $DDNSInterface . " Endereço IP Atualizado " . $DDNSIP) :set DDNSLastIP $DDNSIP } else={ :log error ("DDNS DtDNS: Interface de rede " . $DDNSInterface . " Falha na atualização do endereço IP " . $DDNSIP) } } } #------------------------------------------------------------------------------------------
O procedimento de como implantar um scrip DDNS pode ser encontrado aqui no fórum, por isso não postei. Esse é meu primeiro post, por isso peço desculpas se cometi alguma garfe.