4343
4444# Install curl for ddclient to work around 3.10.0 parsing bug (see #2754)
4545install_if_not curl
46+ # Also ensure curl is installed before ddclient installation
47+ apt-get install curl -y
4648DEBIAN_FRONTEND=noninteractive apt-get install ddclient -y
4749
4850# Test if file exists
@@ -76,6 +78,7 @@ case "$choice" in
7678 PROTOCOL=" cloudflare"
7779 SERVER=" www.cloudflare.com"
7880 USE_SSL=" yes"
81+ USE_ZONE=" yes"
7982 ;;
8083 " deSEC" )
8184 PROVIDER=" deSEC"
@@ -179,10 +182,10 @@ cat << DDCLIENT_CONF > "/etc/ddclient.conf"
179182# /etc/ddclient.conf
180183
181184# Default system settings
182- use=if, if=$IFACE
183185use=web, web=https://api.ipify.org
184186
185- # Work around ddclient 3.10.0+ parsing bug by using curl
187+ # Workaround for ddclient 3.10.0+ parsing bug disabled
188+ # The 'curl=yes' option causes "curl not found" errors even with curl installed
186189# See: https://github.com/ddclient/ddclient/issues/499
187190# and: https://github.com/nextcloud/vm/issues/2754
188191# curl=yes
@@ -198,18 +201,22 @@ login=$LOGIN
198201password=$PASSWORD
199202
200203# Hostname follows:
201- zone=$HOSTNAME
202- $HOSTNAME
203204DDCLIENT_CONF
204205
206+ if [ " $USE_ZONE " = " yes" ]
207+ then
208+ echo " zone=$HOSTNAME " >> /etc/ddclient.conf
209+ fi
210+ echo " $HOSTNAME " >> /etc/ddclient.conf
211+
205212# Test connection
206213msg_box " Everything is set up by now and we will check the connection."
207214if ! ddclient -verbose
208215then
209216 msg_box " Something failed while testing the DDNS update.
210217Please try again by running this script again!"
218+ exit 1
211219else
212220 msg_box " Congratulations, it seems like the initial DDNS update worked!
213221DDclient is now set up correctly!"
214222fi
215- exit
0 commit comments