Skip to content
This repository was archived by the owner on Feb 8, 2021. It is now read-only.

Commit ec58524

Browse files
committed
[master] support linux mint and docker 1.8+
1 parent 96ca4a3 commit ec58524

File tree

1 file changed

+14
-3
lines changed

1 file changed

+14
-3
lines changed

hyper-bootstrap.sh

Lines changed: 14 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,8 @@ PKG_FILE="hyper-latest${DEV_MODE}.tgz"
2121
UNTAR_DIR="hyper-pkg"
2222
SUPPORT_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)
2526
UBUNTU_CODE=(trusty utopic vivid)
2627
DEBIAN_CODE=(jessie wheezy)
2728
CENTOS_VER=(6 7)
@@ -37,7 +38,7 @@ RESET=`tput sgr0`
3738
#Error Message
3839
ERR_ROOT_PRIVILEGE_REQUIRED=(10 "This install script need root privilege, please retry use 'sudo' or root user!")
3940
ERR_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!")
4142
ERR_NOT_SUPPORT_DISTRO_VERSION=(22)
4243
ERR_DOCKER_NOT_INSTALL=(30 "Please install docker 1.5+ first!")
4344
ERR_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

Comments
 (0)