Skip to content

Instantly share code, notes, and snippets.

@ryran
Last active December 19, 2015 15:49
Show Gist options
  • Save ryran/5979541 to your computer and use it in GitHub Desktop.
Save ryran/5979541 to your computer and use it in GitHub Desktop.
A lil distro-checking function for when dealing with sosreports -- mainly this is for looking for non-rhel packages.
#!/bin/bash
# Run with the first argument as the path to the root of an extracted sosreport
function Distro {
ls -l "$1"/etc/*-release; echo
cat "$1"/etc/redhat-release; echo
grep --color=no ^serverURL= "$1"/etc/sysconfig/rhn/up2date; echo
egrep -i 'fedora|centos|oracle|enterprise|uek|suse|nv[0-9]' "$1"/installed-rpms
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment