diff --git a/packages/ns-flashstart/files/flashstart-apply b/packages/ns-flashstart/files/flashstart-apply index fd3e46b41..21b2c6e9c 100644 --- a/packages/ns-flashstart/files/flashstart-apply +++ b/packages/ns-flashstart/files/flashstart-apply @@ -27,7 +27,7 @@ if [ "$enabled" = "1" ]; then /etc/init.d/dnsdist restart fi /usr/share/ns-flashstart/flashstart-auth - crontab -l | grep -q '/usr/share/ns-flashstart/flashstart-auth' || echo '*/30 * * * * sleep $$(( RANDOM % 60 )); /usr/share/ns-flashstart/flashstart-auth' >> /etc/crontabs/root + crontab -l | grep -q '/usr/share/ns-flashstart/flashstart-auth' || echo '*/30 * * * * sleep $(( RANDOM % 60 )); /usr/share/ns-flashstart/flashstart-auth' >> /etc/crontabs/root else crontab -l | grep -v '/usr/share/ns-flashstart/flashstart-auth' | sort | uniq | crontab - rm -f "$conf" diff --git a/packages/ns-flashstart/files/flashstart-auth b/packages/ns-flashstart/files/flashstart-auth index 49c443364..5fe8cb7c4 100644 --- a/packages/ns-flashstart/files/flashstart-auth +++ b/packages/ns-flashstart/files/flashstart-auth @@ -12,6 +12,8 @@ from euci import EUci from nethsec import utils import subprocess +import sys +import syslog u = EUci() @@ -27,6 +29,8 @@ for wan in utils.get_all_wan_devices(u): else: id = user url = f"https://ddns.flashstart.com/nic/update?hostname=&myip=&wildcard=NOCHG&username={id}&password={password}" - cmd = ["curl", "-s", "-o", "/dev/null", "--interface", wan, url] - subprocess.run(cmd) + cmd = ["curl", "-s", "--connect-timeout", "10", "--interface", wan, url] + res = subprocess.run(cmd, capture_output=True, text=True) + if res.returncode != 0: + syslog.syslog(syslog.LOG_ERR, f'Failed to update IP for WAN {wan} -> {id} with error: {res.stdout}') counter = counter + 1