Skip to content
Snippets Groups Projects
Commit 9af6ffe8 authored by Bob Mottram's avatar Bob Mottram
Browse files

Remove existing ddns provider when changing ddns settings

parent a99c7200
No related branches found
No related tags found
No related merge requests found
......@@ -47,6 +47,10 @@ function update_inadyn_config {
fi
if ! grep -q "$DDNS_PROVIDER" /etc/inadyn.conf; then
# remove entry for any previous ddns
sed -i '/^system $/,$d' /etc/inadyn.conf
# add the new provider
{ echo '';
echo "system $DDNS_PROVIDER";
echo ' ssl';
......@@ -58,6 +62,7 @@ function update_inadyn_config {
echo " password $DDNS_PASSWORD" >> /etc/inadyn.conf
fi
else
# change username/password for an existing provider
if [ "$DDNS_USERNAME" ]; then
sed -i "s| username .*| username $DDNS_USERNAME|g" /etc/inadyn.conf
fi
......@@ -65,6 +70,7 @@ function update_inadyn_config {
sed -i "s| password .*| password $DDNS_PASSWORD|g" /etc/inadyn.conf
fi
fi
systemctl enable inadyn
systemctl restart inadyn
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment