diff --git a/src/freedombone-app-htmly b/src/freedombone-app-htmly
index f533c51c..73a61ef6 100755
--- a/src/freedombone-app-htmly
+++ b/src/freedombone-app-htmly
@@ -325,10 +325,8 @@ function remove_htmly {
rm -rf /var/www/$HTMLY_DOMAIN_NAME
fi
if [ $HTMLY_CODE ]; then
- if [ -f /usr/bin/dynamicdns ]; then
- sed -i "/$HTMLY_DOMAIN_NAME/d" /usr/bin/dynamicdns
- sed -i "/$HTMLY_CODE/d" /usr/bin/dynamicdns
- fi
+ sed -i '/HTMLY_DOMAIN_NAME.*/d' $CONFIGURATION_FILE
+ sed -i '/HTMLY_CODE.*/d' $CONFIGURATION_FILE
fi
function_check remove_onion_service
remove_onion_service htmly ${HTMLY_ONION_PORT}
diff --git a/src/freedombone-utils-dns b/src/freedombone-utils-dns
index 88be0069..b1f436f8 100755
--- a/src/freedombone-utils-dns
+++ b/src/freedombone-utils-dns
@@ -108,6 +108,12 @@ function create_freedns_updater {
return
fi
+ # remove any legacy command
+ if [ -f /usr/bin/dynamicdns ]; then
+ rm /usr/bin/dynamicdns
+ fi
+
+ # add the update command to cron
if ! grep -q "/usr/local/bin/freedombone-freedns" /etc/crontab; then
function_check cron_add_mins
cron_add_mins 3 '/usr/local/bin/freedombone-freedns'