From 4a5c1bb4c9c5ca614088a4bd0a833fef0e30287a Mon Sep 17 00:00:00 2001 From: Vivek W <92390419+AryanVBW@users.noreply.github.com> Date: Tue, 16 Jul 2024 22:43:45 +0530 Subject: [PATCH] Update --- wifi. archbase. py | 34 ++++++++++++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 wifi. archbase. py diff --git a/wifi. archbase. py b/wifi. archbase. py new file mode 100644 index 0000000..a1a46cb --- /dev/null +++ b/wifi. archbase. py @@ -0,0 +1,34 @@ +import os +import subprocess +import sys + +def install_dependencies(): + try: + # Update package list and install required packages + distro = get_distro() + if distro in ["arch", "manjaro", "garuda"]: + subprocess.check_call(["sudo", "pacman", "-Syu", "--noconfirm"]) + subprocess.check_call(["sudo", "pacman", "-S", "aircrack-ng", "iw", "--noconfirm"]) + else: + subprocess.check_call(["sudo", "apt-get", "update"]) + subprocess.check_call(["sudo", "apt-get", "install", "-y", "aircrack-ng", "iw"]) + except subprocess.CalledProcessError as e: + print(f"Failed to install dependencies: {e}") + sys.exit(1) + +def get_distro(): + try: + with open("/etc/os-release") as f: + for line in f: + if line.startswith("ID="): + return line.split("=")[1].strip().lower().replace('"', '') + except Exception as e: + print(f"Failed to determine the Linux distribution: {e}") + sys.exit(1) + +def main(): + install_dependencies() + # Add the rest of your script here + +if __name__ == "__main__": + main() \ No newline at end of file