Results 1 to 1 of 1
  1. #1
    Untangler
    Join Date
    Aug 2019
    Posts
    35

    Default Multiple DDNS updates

    Once again, this is a hack to enable some extra functionality, please be aware that as a hack there's always the possibility that it may have unwanted consequences or issues with your system, especially when updating.

    Saying that, I've updated Untangle with this hack in place without any issues as of yet, you do this at your own risk!

    .....

    If you need to update multiple DDNS entries with different interface IP's, it's not possible currently with Untangle. I came up with this solution because I needed to update entries for my primary and secondary WAN interfaces.

    I store the files for this in /root

    /root/restart_ddclient

    Code:
    #!/bin/dash
    
    DDCLIENT_PID="`pgrep custom_dd_`"
    
    if [ -z "$DDCLIENT_PID" ] ; then
    	/root/custom_dd_client -daemon 300 -syslog -pid /var/run/ddclient-custom.pid -file /root/ddclient.conf
    
    elif [ ! /root/ddclient.conf -ot /proc/$DDCLIENT_PID ] ; then
            kill $DDCLIENT_PID
    	/root/custom_dd_client -daemon 300 -syslog -pid /var/run/ddclient-custom.pid -file /root/ddclient.conf
    fi
    Ensure that this is executable (chmod +x custom_dd_client)

    /root/ddclient.conf

    Code:
    pid=/var/run/ddclient-custom.pid
    syslog=yes
    use=if, if=eth0
    protocol=cloudflare
    login=<username>
    password=<password>
    ssl=yes
    server=api.cloudflare.com/client/v4
    zone=test.com
    test.com
    
    use=if, if=eth2
    wan1.test.com
    
    use=if, if=eth0
    wan2.test.com
    You'll need to edit this to match the ddns provider and your dns hostnames and domains, consult the ddclient documentation on how to do this.

    Obtain a ddclient that works for untangle and the dns providers you need to use (later versions may have dependencies so you'll have to deal with that.), the untangle supplied ddclient is in /usr/sbin/ddclient you can probably use this.

    Copy your chosen ddclient to /root/custom_dd_client (we are changing its name to custom_dd_client)

    Important

    At this point, test your ddclient configuration to make sure it works

    Code:
    /root/custom_dd_client -daemon=0 -debug -verbose -noquiet -syslog -pid /var/run/ddclient-custom.pid -file /root/ddclient.conf
    Fix any errors, and once you're happy proceed.

    And finally edit your crontab and add the lines in bold to yours. (/etc/crontab)

    Code:
    # /etc/crontab: system-wide crontab
    # Unlike any other crontab you don't have to run the `crontab'
    # command to install the new version when you edit this file
    # and files in /etc/cron.d. These files also have username fields,
    # that none of the other crontabs do.
    
    MAILTO=""
    SHELL=/bin/sh
    PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
    
    @reboot root /root/restart_ddclient
    @reboot root /root/updatecert >/dev/null
    
    # m h dom mon dow user  command
    17 *    * * *   root    cd / && run-parts --report /etc/cron.hourly
    4 1     * * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.daily )
    47 6    * * 7   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.weekly )
    52 6    1 * *   root    test -x /usr/sbin/anacron || ( cd / && run-parts --report /etc/cron.monthly )
    */5 *    * * *   root    /root/restart_ddclient >/dev/null 2>&1
    0 4     * * *   root    /root/updatecert >/dev/null
    30 4    * * *   root    /root/custombackup >/dev/null
    and reload the crontab:

    Code:
    service cron reload
    You can manually start the custom ddclient by executing

    Code:
    /root/restart_ddclient &
    Last edited by fizzyade; 09-16-2019 at 02:00 PM.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  

SEO by vBSEO 3.6.0 PL2