From 6150ea9b1cb4f22fc8a1064b5a9467303240801a Mon Sep 17 00:00:00 2001 From: Franscobec Date: Sun, 18 Jan 2026 20:29:26 -0500 Subject: [PATCH] Add scripts/togglenetworking.sh --- scripts/togglenetworking.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) create mode 100644 scripts/togglenetworking.sh diff --git a/scripts/togglenetworking.sh b/scripts/togglenetworking.sh new file mode 100644 index 0000000..faa3a9b --- /dev/null +++ b/scripts/togglenetworking.sh @@ -0,0 +1,14 @@ +#!/bin/bash +NO_FORMAT="\e[0m" +F_BOLD="\e[1m" +C_GREEN="\e[38;5;40m" +C_RED="\e[38;5;9m" +C_YELLOW="\033[38;5;226m" + +if systemctl is-active --quiet NetworkManager; then + sudo systemctl stop NetworkManager + echo "${C_YELLOW}Networking is now ${F_BOLD}${C_GREEN}active${NO_FORMAT}" +else + sudo systemctl start NetworkManager + echo "${C_YELLOW}Networking is now ${F_BOLD}${C_RED}inactive${NO_FORMAT}" +fi