@@ -21,7 +21,8 @@ PKG_FILE="hyper-latest${DEV_MODE}.tgz"
2121UNTAR_DIR=" hyper-pkg"
2222SUPPORT_EMAIL=" support@hyper.sh"
2323# ######### Constant ##########
24- SUPPORT_DISTRO=(debian ubuntu fedora centos)
24+ SUPPORT_DISTRO=(debian ubuntu fedora centos linuxmint)
25+ LINUX_MINT_CODE=(rafaela rebecca qiana)
2526UBUNTU_CODE=(trusty utopic vivid)
2627DEBIAN_CODE=(jessie wheezy)
2728CENTOS_VER=(6 7)
@@ -37,7 +38,7 @@ RESET=`tput sgr0`
3738# Error Message
3839ERR_ROOT_PRIVILEGE_REQUIRED=(10 " This install script need root privilege, please retry use 'sudo' or root user!" )
3940ERR_NOT_SUPPORT_PLATFORM=(20 " Sorry, Hyper only support x86_64 platform!" )
40- ERR_NOT_SUPPORT_DISTRO=(21 " Sorry, Hyper only support ubuntu/debian/fedora/centos now!" )
41+ ERR_NOT_SUPPORT_DISTRO=(21 " Sorry, Hyper only support ubuntu/debian/fedora/centos/linuxmint(17.x) now!" )
4142ERR_NOT_SUPPORT_DISTRO_VERSION=(22)
4243ERR_DOCKER_NOT_INSTALL=(30 " Please install docker 1.5+ first!" )
4344ERR_DOCKER_LOW_VERSION=(31 " Need Docker version 1.5 at least!" )
@@ -154,6 +155,15 @@ check_deps_distro() {
154155 esac
155156 fi
156157 case " ${LSB_DISTRO} " in
158+ linuxmint)
159+ if [ " ${LSB_DISTRO} " == " linuxmint" ]
160+ then SUPPORT_CODE_LIST=" ${LINUX_MINT_CODE[@]} " ;
161+ fi
162+ if (echo " ${SUPPORT_CODE_LIST} " | grep -v -w " ${LSB_CODE} " & > /dev/null); then
163+ show_message error " Hyper support ${LSB_DISTRO} ( ${SUPPORT_CODE_LIST} ), but current is ${LSB_CODE} (${LSB_VER} )"
164+ exit ${ERR_NOT_SUPPORT_DISTRO_VERSION[0]}
165+ fi
166+ ;;
157167 ubuntu|debian)
158168 if [ " ${LSB_DISTRO} " == " ubuntu" ]
159169 then SUPPORT_CODE_LIST=" ${UBUNTU_CODE[@]} " ;
@@ -196,6 +206,7 @@ COMMENT
196206 exit ${ERR_DOCKER_NOT_RUNNING[0]}
197207 fi
198208 local DOCKER_VER=$( ${BASH_C} " docker version" 2> /dev/null | sed -ne ' s/Server version:[[:space:]]*\([0-9]\{1,\}\)*/\1/p' )
209+ if [ -z ${DOCKER_VER} ]; then local DOCKER_VER=$( ${BASH_C} " docker version" 2> /dev/null | grep " Server:" -A1 | sed -ne ' s/ Version:[[:space:]]*\([0-9]\{1,\}\)*/\1/p' ) ; fi
199210 set -e
200211 read DMAJOR DMINOR DFIX < <( echo ${DOCKER_VER} | awk -F" ." ' {print $1,$2,$3}' )
201212 if [ -z ${DMAJOR} -o -z ${DMINOR} ]; then
@@ -458,4 +469,4 @@ show_message() {
458469 esac
459470}
460471# ################
461- main
472+ main
0 commit comments