Skip to content

Commit 8ae9c59

Browse files
committed
BUGFIX: exception on first run after initialization
1 parent 4471745 commit 8ae9c59

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

dyndns/domain_update.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -164,7 +164,8 @@ def main(domain, settings='settings.txt', ignore_previous_ip=False):
164164
# force update by the flag
165165
# force update every 7 days to prevent tokens from expire
166166
if not ignore_previous_ip \
167-
and int(time.time()) - config[domain]['last_success'] < 7 * 24 * 60 * 60 \
167+
and ('last_success' not in config[domain]
168+
or int(time.time()) - config[domain]['last_success'] < 7 * 24 * 60 * 60) \
168169
and proto in ip \
169170
and str(ip[proto]) == str(public_ip[proto]):
170171
config[domain]['ip'][proto] = public_ip[proto]

0 commit comments

Comments
 (0)