From 7f41109bc9e52cf3b8a7e74efc7bb1480dbbc574 Mon Sep 17 00:00:00 2001 From: lassulus Date: Wed, 20 Nov 2019 21:38:16 +0100 Subject: l autowifi: convert to submodule --- lass/5pkgs/autowifi | 1 + lass/5pkgs/autowifi/autowifi.py | 228 ---------------------------------------- lass/5pkgs/autowifi/default.nix | 1 - 3 files changed, 1 insertion(+), 229 deletions(-) create mode 160000 lass/5pkgs/autowifi delete mode 100644 lass/5pkgs/autowifi/autowifi.py delete mode 100644 lass/5pkgs/autowifi/default.nix (limited to 'lass/5pkgs/autowifi') diff --git a/lass/5pkgs/autowifi b/lass/5pkgs/autowifi new file mode 160000 index 000000000..cf3ae8f6f --- /dev/null +++ b/lass/5pkgs/autowifi @@ -0,0 +1 @@ +Subproject commit cf3ae8f6fe285eab67db4f36f9a3da3762c35317 diff --git a/lass/5pkgs/autowifi/autowifi.py b/lass/5pkgs/autowifi/autowifi.py deleted file mode 100644 index fa3d007e7..000000000 --- a/lass/5pkgs/autowifi/autowifi.py +++ /dev/null @@ -1,228 +0,0 @@ -import subprocess -import time -import urllib.request -import logging -import argparse -import socket -import struct -import signal -import os - -wifiDB = '' -logger = logging.getLogger() -got_signal = False - - -def signal_handler(signum, frame): - global got_signal - got_signal = True - - -def get_default_gateway() -> str: - """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("