Browse Source

Added formating to timestamp

master
Rune Olsen 1 year ago
parent
commit
d8d9f2bfc8
1 changed files with 3 additions and 3 deletions
  1. +3
    -3
      py-dyndns.py

+ 3
- 3
py-dyndns.py View File

@@ -6,7 +6,7 @@ import logging
import argparse
import requests
import os
from datetime import datetime
import time

# Config stuff

@@ -61,11 +61,11 @@ def runupdate():
if remoteIP4 != local_ip4:
response = updateip(local_ip4, value)
if '200' in response:
logging.info(str(datetime.now())+' - Success! Domain %s updated with IP: %s (old IP: %s)', section,local_ip4,remoteIP4)
logging.info(time.strftime("%Y-%m-%d %H:%M")+' - Success! Domain %s updated with IP: %s (old IP: %s)', section,local_ip4,remoteIP4)
else:
logging.error('Failure! '+response)
else:
logging.info(str(datetime.now())+' - No need to update the IP! Local IP ('+local_ip4+') for '+section+' is the same as '
logging.info(time.strftime("%Y-%m-%d %H:%M")+' - No need to update the IP! Local IP ('+local_ip4+') for '+section+' is the same as '
'Remote IP ('+remoteIP4+')')




Loading…
Cancel
Save