Created
June 11, 2015 19:30
-
-
Save linux-modder/51b71b4fe91ade5cedff to your computer and use it in GitHub Desktop.
net check + dnf check
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
## check for networking | |
2>/dev/null >/dev/tcp/google.com/80 | |
if [ $? -eq 0 ]; then | |
ping -c 5 -q 8.8.8.8 ; | |
echo "Networking is Up and Running" || echo ""Networking is Down or Misconfigured" | |
## now to check dnf / yum for updates | |
if [ $? -eq 0]; then | |
su -c 'dnf update' | |
exit | |
elif | |
sudo dnf update | |
exit | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment