Fix script to work on both RHEL 6 and Ubuntu 12.04