Hi Niklas,
I am able to find the issue why the script seems to fail and I think it is an issue in the script.
The problem here is the versioning of RHEL server is bit different as compare to 6.8 and higher. In current case the issue is if we run below command on 6.8 Red hat
rpm -q --qf "%{VERSION}" $(rpm -q --whatprovides redhat-release)
Result will be
6Server
and same on 7.1 Redhat will result in 7.1
The reason for this is because the versioning is different for 6.8 as compare to 7.1
Internal command i.e.rpm -q --whatprovides redhat-release will result below summary for RPM packages
7.1 packages: redhat-release-server-7.1-1.el7.x86_64
6.8 package: redhat-release-server-6Server-6.8.0.5.el6.x86_64
the result error is because the comparison of version in script fails.
Thanks,
Saurabh