diff --git a/actions/dynamicdns b/actions/dynamicdns index 2746967da..46118a7b3 100755 --- a/actions/dynamicdns +++ b/actions/dynamicdns @@ -25,7 +25,7 @@ WGET=$(which wget) WGETOPTIONS="-o /dev/null -t 3 -T 3" EMPTYSTRING="none" NOIP="0.0.0.0" -# how often do we poll for IP changes if we are behind a NAT? +# how often do we poll for IP changes UPDATEMINUTES=5 # if we do not have a URL to look up public IP, how often should we do # a "blind" update @@ -146,19 +146,6 @@ doWriteCFG() # check if we are behind a NAT Router echo "IPURL ${ipurl}" >> ${HELPERCFG} - if [ -z ${ipurl} ];then - echo "NAT unknown" >> ${HELPERCFG} - else - doGetWANIP - ISGLOBAL=$(ip addr ls "${default_interface}" | grep "${wanip}") - if [ -z "${ISGLOBAL}" ];then - # we are behind NAT - echo "NAT yes" >> ${HELPERCFG} - else - # we are directly connected - echo "NAT no" >> ${HELPERCFG} - fi - fi } # this function will read the config file from disk @@ -357,11 +344,6 @@ case ${cmd} in echo "*/${UPDATEMINUTES} * * * * root ${0} update" > $CRONJOB $0 update ;; - get-nat) - NAT=$(grep ^NAT $HELPERCFG 2> /dev/null | awk '{print $2}') - [ -z "${NAT}" ] && NAT="unknown" - echo ${NAT} - ;; update) doReadCFG dnsentry=$(nslookup "${host}"|tail -n2|grep A|sed s/[^0-9.]//g) @@ -425,15 +407,12 @@ case ${cmd} in doReadCFG doStatus ;; - get-timer) - echo ${UPDATEMINUTES} - ;; clean) rm ${CFGDIR}/* rm ${CRONJOB} ;; *) - echo "usage: status|configure |start|stop|update|get-nat|clean|success [updated IP]|failed|get-last-success" + echo "usage: status|configure |start|stop|update|clean|success [updated IP]|failed|get-last-success" echo "" echo "options are:" echo "-s Gnudip Server address" @@ -451,7 +430,6 @@ case ${cmd} in echo "clean delete configuration" echo "success store update success and optional the updated IP" echo "failed store update failure" - echo "get-nat return the detected nat type" echo "get-last-success return date of last successful update" ;; esac diff --git a/plinth/modules/dynamicdns/templates/dynamicdns.html b/plinth/modules/dynamicdns/templates/dynamicdns.html index b66eba8c5..37296190f 100644 --- a/plinth/modules/dynamicdns/templates/dynamicdns.html +++ b/plinth/modules/dynamicdns/templates/dynamicdns.html @@ -29,33 +29,7 @@ {% block extra_content %}

{% trans "Status" %}

-

{% trans "NAT type" %}

- -

- {% if status.nat_unchecked %} - {% blocktrans trimmed %} - NAT type was not detected yet. If you do not provide an "IP Check - URL", we will not detect a NAT type. - {% endblocktrans %} - {% else %} - {% if status.no_nat %} - {% trans "Direct connection to the Internet." %} - {% else %} - {% blocktrans trimmed with timer=status.timer %} - Behind NAT. This means that Dynamic DNS service will poll - the "URL to look up public IP" for changes (the "URL to look - up public IP" entry is needed for this, otherwise IP changes - will not be detected). In case the WAN IP changes, it may - take up to {{ timer }} minutes until your DNS entry is - updated. - {% endblocktrans %} - {% endif %} - {% endif %} -

- -

{% trans "Last update" %}

- -

{{ status.last_update }}

+

{% trans "Last update" %}: {{ status.last_update }}

{% endblock %} {% block page_js %} diff --git a/plinth/modules/dynamicdns/views.py b/plinth/modules/dynamicdns/views.py index 2a7b9ad2d..85e8c2c73 100644 --- a/plinth/modules/dynamicdns/views.py +++ b/plinth/modules/dynamicdns/views.py @@ -45,19 +45,7 @@ def index(request): def get_status(): """Return the current status.""" - check_nat = _run(['get-nat']) - last_update = _run(['get-last-success']) - - no_nat = check_nat.strip() == 'no' - nat_unchecked = check_nat.strip() == 'unknown' - timer = _run(['get-timer']) - - return { - 'no_nat': no_nat, - 'nat_unchecked': nat_unchecked, - 'timer': timer, - 'last_update': last_update, - } + return {'last_update': _run(['get-last-success'])} def _apply_changes(request, old_status, new_status):