You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
def check_system_time():
try:
local_time = datetime.datetime.utcnow()
aws_time = subprocess.check_output("curl -s --head http://google.com | grep '^date:' | cut -d' ' -f3-6", shell=True).decode().strip()
if aws_time:
aws_time = datetime.datetime.strptime(aws_time, "%d %b %Y %H:%M:%S")
time_diff = abs((aws_time - local_time).total_seconds())
if time_diff > 300: # More than 5 minutes difference
print(f"⚠️ WARNING: System clock is out of sync! (Drift: {int(time_diff)} seconds)")
print("🔥 FireProx may fail due to AWS signature expiration. Run sudo timedatectl set-ntp on to fix.")
except Exception as e:
print(f"⚠️ Could not verify system time: {e}")
check_system_time()
The text was updated successfully, but these errors were encountered:
import datetime
import subprocess
def check_system_time():⚠️ WARNING: System clock is out of sync! (Drift: {int(time_diff)} seconds)")⚠️ Could not verify system time: {e}")
try:
local_time = datetime.datetime.utcnow()
aws_time = subprocess.check_output("curl -s --head http://google.com | grep '^date:' | cut -d' ' -f3-6", shell=True).decode().strip()
if aws_time:
aws_time = datetime.datetime.strptime(aws_time, "%d %b %Y %H:%M:%S")
time_diff = abs((aws_time - local_time).total_seconds())
if time_diff > 300: # More than 5 minutes difference
print(f"
print("🔥 FireProx may fail due to AWS signature expiration. Run
sudo timedatectl set-ntp on
to fix.")except Exception as e:
print(f"
check_system_time()
The text was updated successfully, but these errors were encountered: