#!/usr/bin/env python3 import configparser import uuid import re import os import socket, struct import requests import sys import socket import fileinput import json import lsb_release import psutil def get_default_gateway_linux(): """Read the default gateway directly from /proc.""" with open("/proc/net/route") as fh: for line in fh: fields = line.strip().split() if fields[1] != '00000000' or not int(fields[3], 16) & 2: continue return socket.inet_ntoa(struct.pack("