Skip to content

Instantly share code, notes, and snippets.

@linux-modder
Created June 11, 2015 19:30
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save linux-modder/51b71b4fe91ade5cedff to your computer and use it in GitHub Desktop.
Save linux-modder/51b71b4fe91ade5cedff to your computer and use it in GitHub Desktop.
net check + dnf check
## 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