Skip to content

Instantly share code, notes, and snippets.

@carlbennett
Created July 21, 2018 23:30
Show Gist options
  • Save carlbennett/393479d4da8c82adb1f794db9c49f0eb to your computer and use it in GitHub Desktop.
Save carlbennett/393479d4da8c82adb1f794db9c49f0eb to your computer and use it in GitHub Desktop.
Updates the system using either dnf or yum (whichever's available)
#!/bin/sh
/usr/bin/yum --version | /usr/bin/grep dnf >/dev/null 2>&1
[ $? -eq 0 ] && DNF=1 || DNF=0
if [ $DNF -eq 0 ]; then
/usr/bin/yum update -y
else
/usr/bin/dnf update -y --refresh
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment