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 --- .gitmodules | 6 ++ lass/5pkgs/autowifi | 1 + lass/5pkgs/autowifi/autowifi.py | 228 ---------------------------------------- lass/5pkgs/autowifi/default.nix | 1 - 4 files changed, 7 insertions(+), 229 deletions(-) create mode 160000 lass/5pkgs/autowifi delete mode 100644 lass/5pkgs/autowifi/autowifi.py delete mode 100644 lass/5pkgs/autowifi/default.nix diff --git a/.gitmodules b/.gitmodules index f35a9250d..15d1b41de 100644 --- a/.gitmodules +++ b/.gitmodules @@ -4,3 +4,9 @@ [submodule "submodules/krops"] path = submodules/krops url = https://cgit.krebsco.de/krops +[submodule "lass/5pkgs/autowifi"] + path = lass/5pkgs/autowifi + url = https://github.com/Lassulus/autowifi +[submodule "lass/5pkgs/--force"] + path = lass/5pkgs/--force + url = https://github.com/Lassulus/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("