#!/bin/bash # Currently Supported Operating Systems: # # RHEL 5, 6, 7 # CentOS 5, 6, 7 # Debian 7, 8 # Ubuntu 12.04 - 18.04 # SUSE 12- 15 # APP_DIR=$(pwd) CONFIG_DIR="$APP_DIR" SNPDPL_APP="" # Am I root? if [ "x$(id -u)" != 'x0' ]; then echo 'Error: this script can only be executed by root' exit 1 fi # Detect OS if [ -f /etc/os-release ];then source /etc/os-release type=$ID else [ -f /etc/redhat-release ];then type=rhel fi #case $(head -n1 /etc/issue | cut -f 1 -d ' ') in # Debian) type="debian" ;; # Ubuntu) type="ubuntu" ;; # Amazon) type="amazon" ;; # Amazon) type="suse" ;; # *) type="rhel" ;; #esac if [[ "$type" == "debian" ]]; then chmod a+x "${APP_DIR}/install-${type}.sh" bash "${APP_DIR}/install-${type}.sh" $* elif [[ "$type" == "ubuntu" ]]; then chmod a+x "${APP_DIR}/scripts/install-${type}.sh" bash "${APP_DIR}/scripts/install-${type}.sh" $* elif [[ "$type" == "suse" ]]; then chmod a+x "${APP_DIR}/scripts/snpdpl-install-${type}.sh" bash "${APP_DIR}/scripts/install-${type}.sh" $* elif [[ "$type" == "rhel" ]]; then chmod a+x "${APP_DIR}/scripts/install-${type}.sh" bash "${APP_DIR}/scripts/install-${type}.sh" $* elif [[ "$type" == "amazon" ]]; then chmod a+x "${APP_DIR}/scripts/install-${type}.sh" bash "${APP_DIR}/scripts/install-${type}.sh" $* else chmod a+x "${APP_DIR}/scripts/install-${type}.sh" bash "${APP_DIR}/scripts/install-${type}.sh" $* fi exit