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

Change inadyn username and password

parent 782d5567
No related branches found
No related tags found
No related merge requests found
......@@ -33,6 +33,38 @@ export TEXTDOMAINDIR="/usr/share/locale"
source "/usr/share/${PROJECT_NAME}/utils/${PROJECT_NAME}-utils-config"
function update_inadyn_config {
if [ ! -f /etc/inadyn.conf ]; then
return
fi
if [[ "$DDNS_PROVIDER" == *'freedns'* ]]; then
return
fi
if ! grep -q "$DDNS_PROVIDER" /etc/inadyn.conf; then
{ echo '';
echo "system $DDNS_PROVIDER";
echo ' ssl';
echo " checkip-url $GET_IP_ADDRESS_URL /"; } >> /etc/inadyn.conf
if [ "$DDNS_USERNAME" ]; then
echo " username $DDNS_USERNAME" >> /etc/inadyn.conf
fi
if [ "$DDNS_PASSWORD" ]; then
echo " password $DDNS_PASSWORD" >> /etc/inadyn.conf
fi
else
if [ "$DDNS_USERNAME" ]; then
sed -i "s| username .*| username $DDNS_USERNAME|g" /etc/inadyn.conf
fi
if [ "$DDNS_PASSWORD" ]; then
sed -i "s| password .*| password $DDNS_PASSWORD|g" /etc/inadyn.conf
fi
fi
systemctl enable inadyn
systemctl restart inadyn
}
function dynamic_dns_setup {
DDNS_PROVIDER='none'
......@@ -173,6 +205,7 @@ function dynamic_dns_setup {
fi
done
save_configuration_values
update_inadyn_config
fi
}
......
......@@ -137,6 +137,9 @@ function add_ddns_domain {
if [[ $ONION_ONLY != "no" ]]; then
return
fi
if [ ! "$DDNS_PROVIDER" ]; then
return
fi
if [[ "$DDNS_PROVIDER" == 'none' ]]; then
return
fi
......
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