diff --git a/hyper-bootstrap.sh b/hyper-bootstrap.sh index 318aad4..8ccaaa1 100755 --- a/hyper-bootstrap.sh +++ b/hyper-bootstrap.sh @@ -1,5 +1,5 @@ #!/bin/bash -# Description: This script is used to install hyper cli and hyperd +# Description: This script is used to install hyperctl and hyperd # Usage: # install from remote # wget -qO- http://hypercontainer.io/install | bash @@ -14,16 +14,16 @@ CURRENT_USER="$(id -un 2>/dev/null || true)" BOOTSTRAP_DIR="/tmp/hyper-bootstrap-${CURRENT_USER}" BASH_C="bash -c" ########## Parameter ########## -S3_URL="http://hyper-install.s3.amazonaws.com" +S3_URL="http://hypercontainer-install.s3.amazonaws.com" PKG_FILE="hyper-latest.tgz" UNTAR_DIR="hyper-pkg" SUPPORT_EMAIL="support@hyper.sh" ############ RPM ############## CENTOS7_QEMU_HYPER="qemu-hyper-2.4.1-2.el7.centos.x86_64" -CENTOS7_HYPERSTART="hyperstart-0.5-1.el7.centos.x86_64" -CENTOS7_HYPER="hyper-0.5-1.el7.centos.x86_64" -FC23_HYPERSTART="hyperstart-0.5-1.fc23.x86_64" -FC23_HYPER="hyper-0.5-1.fc23.x86_64" +CENTOS7_HYPERSTART="hyperstart-0.6-1.el7.centos.x86_64" +CENTOS7_HYPER="hyper-container-0.6-1.el7.centos.x86_64" +FC23_HYPERSTART="hyperstart-0.6-1.fc23.x86_64" +FC23_HYPER="hyper-container-0.6-1.fc23.x86_64" ########## Constant ########## SUPPORT_DISTRO=(debian ubuntu fedora centos linuxmint) LINUX_MINT_CODE=(rafaela rebecca qiana) @@ -61,7 +61,7 @@ ERR_UNKNOWN_MSG_TYPE=98 ERR_UNKNOWN=99 ########## Function Definition ########## main() { - show_message info "Welcome to Install Community Edition of Hyper...\n" + show_message info "Welcome to Install Community Edition of HyperContainer...\n" check_user check_os_platform check_os_distro @@ -86,10 +86,10 @@ main() { exit 0 } check_hyper_before_install() { - if (command_exist hyper hyperd);then + if (command_exist hyperctl hyperd);then echo "${WHITE}" cat </dev/null 2>&1" + ${BASH_C} "ping -c 3 -W 2 hypercontainer-install.s3.amazonaws.com >/dev/null 2>&1" if [ $? -ne 0 ];then - S3_URL="http://mirror-hyper-install.s3.amazonaws.com" + S3_URL="http://mirror-hypercontainer-install.s3.amazonaws.com" else - S3_URL="http://hyper-install.s3.amazonaws.com" + S3_URL="http://hypercontainer-install.s3.amazonaws.com" fi local SRC_URL="${S3_URL}/${PKG_FILE}" local TGT_FILE="${BOOTSTRAP_DIR}/${PKG_FILE}" @@ -316,11 +316,11 @@ install_hyper() { show_message error "${ERR_EXEC_INSTALL_FAILED[1]}" && exit "${ERR_EXEC_INSTALL_FAILED[0]}" fi echo -n "." - if [[ -f /usr/local/bin/hyper ]] && [[ -f /usr/local/bin/hyperd ]] && [[ ! -f /usr/bin/hyper ]] && [[ ! -f /usr/bin/hyperd ]] ;then - ${BASH_C} "ln -s /usr/local/bin/hyper /usr/bin/hyper" + if [[ -f /usr/local/bin/hyperctl ]] && [[ -f /usr/local/bin/hyperd ]] && [[ ! -f /usr/bin/hyperctl ]] && [[ ! -f /usr/bin/hyperd ]] ;then + ${BASH_C} "ln -s /usr/local/bin/hyperctl /usr/bin/hyperctl" ${BASH_C} "ln -s /usr/local/bin/hyperd /usr/bin/hyperd" fi - if (command_exist hyper hyperd);then + if (command_exist hyperctl hyperd);then install_hyperd_service echo -n "." else @@ -382,8 +382,8 @@ start_hyperd_service() { show_message success "\nhyperd is running." cat </dev/null 2>&1" + ${BASH_C} "ping -c 3 -W 2 hypercontainer-install.s3.amazonaws.com >/dev/null 2>&1" if [ $? -ne 0 ];then - S3_URL="http://mirror-hyper-install.s3.amazonaws.com" + S3_URL="http://mirror-hypercontainer-install.s3.amazonaws.com" else - S3_URL="http://hyper-install.s3.amazonaws.com" + S3_URL="http://hypercontainer-install.s3.amazonaws.com" fi case "$1" in centos7) @@ -414,11 +421,12 @@ install_from_rpm(){ if [ $? -eq 0 ];then show_message info "${ERR_HYPER_NO_NEW_VERSION[1]}"; exit 1 fi - if (command_exist hyper hyperd);then + if (command_exist hyperctl hyperd);then _ACT="update" else _ACT="install" fi + handle_hyper_rpm_rename ${BASH_C} "yum ${_ACT} -y ${S3_URL}/${CENTOS7_QEMU_HYPER}.rpm ${S3_URL}/${CENTOS7_HYPERSTART}.rpm ${S3_URL}/${CENTOS7_HYPER}.rpm" ;; fedora23) @@ -426,12 +434,13 @@ install_from_rpm(){ if [ $? -eq 0 ];then show_message info "${ERR_HYPER_NO_NEW_VERSION[1]}"; exit 1 fi - if (command_exist hyper hyperd);then + if (command_exist hyperctl hyperd);then _ACT="update" else _ACT="install" fi - ${BASH_C} "dnf ${_ACT} ${S3_URL}/${FC23_HYPERSTART}.rpm ${S3_URL}/${FC23_HYPER}.rpm" + handle_hyper_rpm_rename + ${BASH_C} "dnf ${_ACT} -y ${S3_URL}/${FC23_HYPERSTART}.rpm ${S3_URL}/${FC23_HYPER}.rpm" ;; *) show_message error "rpm install support centos7 & fedora23 only"; exit 1;; esac