Add scripts/togglenetworking.sh
This commit is contained in:
14
scripts/togglenetworking.sh
Normal file
14
scripts/togglenetworking.sh
Normal file
@@ -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
|
||||||
Reference in New Issue
Block a user