22# Description: This script is used to install hyper cli and hyperd
33# Usage:
44# install from remote
5- # wget -qO- https://cli. hyper.sh/install | bash
6- # curl -sSL https://cli. hyper.sh/install | bash
5+ # wget -qO- https://hyper.sh/install | bash
6+ # curl -sSL https://hyper.sh/install | bash
77# install from local
8- # ./bootstrap.sh
8+ # ./hypercli- bootstrap.sh
99WORK_DIR=$( pwd)
1010BASE_DIR=$( cd " $( dirname " $0 " ) " ; pwd) ; cd ${BASE_DIR}
1111SLEEP_SEC=10
@@ -63,6 +63,7 @@ show_message() {
6363}
6464# ######### Main Function Definition ##########
6565main () {
66+ show_message info " Welcome to Install hyper client for HYPER_...\n"
6667 check_os_type
6768 fetch_hypercli
6869 extract_hypercli
@@ -141,7 +142,7 @@ fetch_hypercli() {
141142 MD5_LOCAL=$( md5 ${TGT_FILE} | awk ' {print $NF}' )
142143 ;;
143144 esac
144- if [ ${MD5_REMOTE} != ${MD5_LOCAL} ]; then
145+ if [[ ${MD5_REMOTE} != ${MD5_LOCAL} ] ]; then
145146 echo " required checksum: ${MD5_REMOTE} , but downloaded package is ${MD5_LOCAL} "
146147 show_message error " ${ERR_PKG_MD5_ERROR[1]} " && exit " ${ERR_PKG_MD5_ERROR[0]} "
147148 fi
@@ -150,17 +151,20 @@ fetch_hypercli() {
150151 set -e
151152}
152153extract_hypercli () {
154+ cd ${WORK_DIR}
153155 case " ${OS_TYPE} " in
154156 Linux) PKG_FILE=" ${PKG_FILE_LINUX} "
155157 ${BASH_C} " tar xzf ${BOOTSTRAP_DIR} /${PKG_FILE} -C ${WORK_DIR} "
158+ md5sum hyper | awk ' {printf "MD5 (hyper) = %s\n", $1}'
156159 ;;
157160 Darwin) PKG_FILE=" ${PKG_FILE_MACOSX} "
158161 ${BASH_C} " unzip -o ${BOOTSTRAP_DIR} /${PKG_FILE} -d ${WORK_DIR} "
162+ md5 hyper
159163 ;;
160164 * ) show_message error " ${ERR_NOT_SUPPORT_OS[1]} " && exit " ${ERR_NOT_SUPPORT_OS[0]} "
161165 ;;
162166 esac
163- chmod +x ${WORK_DIR} / hyper
167+ chmod +x hyper
164168 cat << EOF
165169hypercli '${WORK_DIR} /hyper' is ready
166170
@@ -173,6 +177,7 @@ QuickStart:
173177 ./hyper ps -l
174178
175179For more information, please go to https://docs.hyper.sh
180+ For Community Edition of Hyper, please go to http://hypercontainer.io
176181EOF
177182}
178183
0 commit comments