If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.
I switched from Windows Server to a Arch LInux server with my scripts and applications. Therefore, I needed to port over my PowerShell script to something linux compatible to continue keeping my DDNS up-to-date. After some trial and error and some researching, here's a script to update Strato DDNS via a bash script!
Code:
#!/bin/bash
HOST=domain.de
PASS=mySecretPassword
CUR_IP=$(curl -s https://api.ipify.org)
if [ "$(<~/.oldipaddress)" != "$CUR_IP" ]
then
echo $CUR_IP > ~/.oldipaddress
echo "[$(date '+%Y-%m-%d %H:%M:%S')] $(curl --silent --show-error --insecure --user $HOST:$PASS https://dyndns.strato.com/nic/update?hostname=$HOST)" >> ~/stratologs.txt
else
echo "[$(date '+%Y-%m-%d %H:%M:%S')] No change." >> ~/stratologs.txt
fi
With a cronjob executed every 5 mins, it checks through the website https://api.ipify.org the current internet IP address. Then it compares it with a previously saved IP address in the home directory of the current user. If the addresses are not equal, it updates the file and "curls" the strato https address with the given HOST and PASS variable to update the IP address.
We process personal data about users of our site, through the use of cookies and other technologies, to deliver our services, personalize advertising, and to analyze site activity. We may share certain information about our users with our advertising and analytics partners. For additional details, refer to our Privacy Policy.
By clicking "I AGREE" below, you agree to our Privacy Policy and our personal data processing and cookie practices as described therein. You also acknowledge that this forum may be hosted outside your country and you consent to the collection, storage, and processing of your data in the country where this forum is hosted.