diff --git a/src/freedombone-ddns b/src/freedombone-ddns index fb694f9db5c274bae071dd9c9c4fdc45f8e58ccb..e8028c030975ca3e2d12743d1b83ec72ed98b71a 100755 --- a/src/freedombone-ddns +++ b/src/freedombone-ddns @@ -229,8 +229,13 @@ function choose_dynamic_dns_noninteractive { save_configuration_values update_inadyn_config if [ -f /etc/systemd/system/inadyn.service ]; then - systemctl enable inadyn - systemctl restart inadyn + if [[ "$DDNS_PROVIDER" == *"freedns"* ]]; then + systemctl stop inadyn + systemctl disable inadyn + else + systemctl enable inadyn + systemctl restart inadyn + fi fi fi } diff --git a/src/freedombone-installer b/src/freedombone-installer index fcbf2b5d815546280f1862e8aa389bee00f6faf9..cd51777a0fa489e97a93a855163befc64f7905ba 100755 --- a/src/freedombone-installer +++ b/src/freedombone-installer @@ -2613,14 +2613,6 @@ function update_dynamic_dns { fi regenerate_dynamic_dns "$ddns" "$ddns_username" "$ddns_password" "$ddns_code" - - if [[ "$ddns_code" == *'freedns'* ]]; then - if ! grep -q "/usr/local/bin/${PROJECT_NAME}-freedns" /etc/crontab; then - echo "*/1 * * * * root /usr/local/bin/${PROJECT_NAME}-freedns" >> /etc/crontab - fi - else - sed -i '/freedns/d' /etc/crontab - fi fi rm "$dynamic_dns_file" diff --git a/src/freedombone-utils-dns b/src/freedombone-utils-dns index 32a1222661d54453171dc0bfb9d9ab3ef6147292..7811f61a58d06de150b42724f54ecae5d87d856f 100755 --- a/src/freedombone-utils-dns +++ b/src/freedombone-utils-dns @@ -101,11 +101,18 @@ function enable_mdns { } function update_inadyn_config { - if [ ! -f "${INADYN_CONFIG_FILE}" ]; then + if [[ "$DDNS_PROVIDER" == *'freedns'* ]]; then + if ! grep -q "/usr/local/bin/${PROJECT_NAME}-freedns" /etc/crontab; then + echo "*/1 * * * * root /usr/local/bin/${PROJECT_NAME}-freedns" >> /etc/crontab + fi return fi - if [[ "$DDNS_PROVIDER" == *'freedns'* ]]; then + if grep -q 'freedns' /etc/crontab; then + sed -i '/freedns/d' /etc/crontab + fi + + if [ ! -f "${INADYN_CONFIG_FILE}" ]; then return fi