Added support for RHEL 5 and RHEL 6 with automatic detection