Last active
August 2, 2021 16:54
-
-
Save KevinLiebergen/b6562341bfbf1f262a797428eccd8d86 to your computer and use it in GitHub Desktop.
Script to restart network daemon when it fucking fails
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
ping -c 1 -W 1 1.1.1.1 || sudo systemctl restart NetworkManager.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
$ sudo visudo
And insert line (to not ask for password every time):
kevinvanliebergen ALL=NOPASSWD: /bin/systemctl restart NetworkManager.service
Change kevinvanliebergen to your username