Author Topic: Dynamic DNS Command (Auto variable IP update)  (Read 2138 times)

0 Members and 1 Guest are viewing this topic.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Dynamic DNS Command (Auto variable IP update)
« on: January 20, 2015, 01:40:38 PM »
I use a dynamic DNS service to remotely access various stuff at home ... till now I maintain the IP updated using No-IP DUC program that consumes up to 7MB of memory when not minimized and 1 MB minimized ... since I run VCon an old PC (2.5GB ram), ram is an issue for me ...

so here is a command that do the trick so no extra programs to run, no extra icon in the tray and most save some valuable ram.
as well, with a bit of modification, you can make VC email or skype message ..etc. latest IP and drop the DynDNS completely

it starts with VC and check every 5 minutes (you can revise the delay in the first command)

(Bug fixed 2015'01'25)

Code: [Select]
<?xml version="1.0" encoding="utf-16"?>
<!--VoxCommando 2.1.3.6-->
<command id="337" name="Dynamic DNS No-IP" enabled="true" alwaysOn="False" confirm="False" requiredConfidence="0" loop="False" loopDelay="0" loopMax="0" description="">
  <action>
    <cmdType>VC.SetEventTimer</cmdType>
    <params>
      <param>300</param>
      <param>Network.UpdateNO-IP</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Scrape</cmdType>
    <params>
      <param>http://myexternalip.com/raw</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <action>
    <cmdType>Results.RegEx</cmdType>
    <params>
      <param>(\d+).(\d+).(\d+).(\d+)</param>
      <param>.</param>
      <param>{LastResult}</param>
      <param>clean up IP</param>
    </params>
    <cmdRepeat>1</cmdRepeat>
  </action>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)==(B)</ifType>
    <ifParams>{Match.1}&amp;&amp;{M:Variables.CurrentIP}</ifParams>
    <then>
      <action>
        <cmdType>VcAdvanced.Log</cmdType>
        <params>
          <param>No-IP: no change in IP ({LastResult})</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>VC.StopMacro</cmdType>
        <params />
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>Scrape</cmdType>
        <params>
          <param>http://dynupdate.no-ip.com/nic/update?hostname={M:Credentials.No-IPHost}&amp;myip{LastResult}</param>
          <param>{M:Credentials.StID}</param>
          <param>{M:Credentials.StPassword}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <if ifBlockDisabled="False" ifNot="False">
    <ifType>(A)Contains(B)</ifType>
    <ifParams>{LastResult}&amp;&amp;good</ifParams>
    <then>
      <action>
        <cmdType>VcAdvanced.Log</cmdType>
        <params>
          <param>No-IP:  Success, IP updated to: {LastResult} old IP: {M:Variables.CurrentIP}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Results.Replace</cmdType>
        <params>
          <param>good </param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
      <action>
        <cmdType>Map.Set</cmdType>
        <params>
          <param>Variables</param>
          <param>CurrentIP</param>
          <param>{LastResult}</param>
          <param>True</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </then>
    <else>
      <action>
        <cmdType>VcAdvanced.Log</cmdType>
        <params>
          <param>No-IP:  failed: {LastResult}</param>
        </params>
        <cmdRepeat>1</cmdRepeat>
      </action>
    </else>
  </if>
  <event>Network.UpdateNO-IP</event>
  <event>VC.Loaded</event>
</command>
« Last Edit: January 25, 2015, 07:07:51 PM by Haddood »
When Voice command gets tough, use hand gestures

jitterjames

  • Administrator
  • Hero Member
  • *****
  • Posts: 7714
  • Karma: 116
    • View Profile
    • VoxCommando
Re: Dynamic DNS Command (Auto variable IP update)
« Reply #1 on: January 20, 2015, 04:09:51 PM »
Thanks for the command.  Should come in handy for some and prove educational for others.

You are probably already aware but the majority of modern routers come with this capability built-in.

Haddood

  • $upporter
  • Hero Member
  • *****
  • Posts: 688
  • Karma: 22
    • View Profile
Re: Dynamic DNS Command (Auto variable IP update)
« Reply #2 on: January 20, 2015, 06:00:22 PM »
You are probably already aware but the majority of modern routers come with this capability built-in.
Yep but not all of them support all providers
When Voice command gets tough, use hand gestures