Skip to content

Simple Bash Scripts to automate restarting the NetworkManager and checking the network status on Linux 🐧.

License

Notifications You must be signed in to change notification settings

queirozz8/network-reset

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

5 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

image

🟣 NetworkManager Quick Reset πŸ”„

Simple bash scripts to automate restarting the NetworkManager and checking the network status on Linux 🐧.


⚑ The Problem

On some Linux distributions, it's common to face random network issues, especially when dealing with proprietary drivers or certain Wi-Fi cards πŸ“‘. A usual quick fix is to manually run:

sudo systemctl restart NetworkManager
nmcli device status

But in the most part of the resets, you need to do this multiple times (at least at my case). Remembering these hard commands and doing multiple times becomes annoying.

βœ… The Solution

I created small and handy scripts to automate this process, making it faster and easier πŸ’‘.

πŸ“œ Included Scripts

network-reset.sh πŸ”„ – Automatically restarts the NetworkManager infinite times until you press Ctrl + C to stop when it works.

network-status.sh πŸ“Š – Shows the current network status using nmcli infinite times until you press Ctrl + C to stop when you're done.

πŸ› οΈ Requirements

  • Linux distro with systemd and NetworkManager 🐧;
  • Bash or Zsh installed;
  • nmcli installed (usually comes with NetworkManager).

πŸ’‘ Usage

  1. Normally, you should create a bin/ directory in your $HOME for downloading the scripts. But this is optional;
  2. Install the scripts;
  3. Go to the directory where the scripts were installed:
cd ~/bin/

(Or another directory)

  1. Allow execution of the scripts:
chmod +x network-reset-zsh.sh network-status-zsh.sh

5.1. Just run the scripts directly:

./network-reset.sh
./network-status.sh

5.2. Or, create aliases in your .zshrc / .bashrc to make them even faster ⚑:

alias net-r="$HOME/bin/network-reset-zsh.sh"
alias net-s="$HOME/bin/network-status-zsh.sh"

About

Simple Bash Scripts to automate restarting the NetworkManager and checking the network status on Linux 🐧.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages