Major rework of the script for supporting CentOS as well as Ubuntu.