Updated script to work with CentOS 7.