@@ -33,7 +33,7 @@ LINUX_MINT_CODE=(rafaela rebecca qiana)
33
33
UBUNTU_CODE=(trusty utopic vivid wily xenial)
34
34
DEBIAN_CODE=(jessie wheezy)
35
35
CENTOS_VER=(6 7)
36
- FEDORA_VER=(20 21 22 23)
36
+ FEDORA_VER=(20 21 22 23 24 )
37
37
# Color Constant
38
38
RED=` tput setaf 1`
39
39
GREEN=` tput setaf 2`
@@ -53,6 +53,7 @@ ERR_QEMU_LOW_VERSION=(41 "Need Qemu version 2.0 at least!")
53
53
ERR_XEN_NOT_INSTALL=(50 " Please install xen 4.5+ first!" )
54
54
ERR_XEN_GET_VER_FAILED=(51 " Can not get xen version, xen daemon isn't running!" )
55
55
ERR_XEN_VER_LOW=(52 " Sorry, hyper only support xen 4.5+" )
56
+ ERR_LIBVIRT_NOT_INSTALL=(53 " hypercontainer depends on libvirt0, please install libvirt0 first!" )
56
57
ERR_FETCH_INST_PKG_FAILED=(60 " Fetch install package failed, please retry!" )
57
58
ERR_INST_PKG_MD5_ERROR=(61 " Checksum of install package error, please retry!" )
58
59
ERR_UNTAR_PKG_FAILED=(62 " Untar install package failed!" )
@@ -72,6 +73,8 @@ main() {
72
73
install_from_rpm " centos7"
73
74
elif [[ " ${LSB_DISTRO} " == " fedora" ]] && [[ " ${CMAJOR} " == " 23" ]]; then
74
75
install_from_rpm " fedora23"
76
+ elif [[ " ${LSB_DISTRO} " == " fedora" ]] && [[ " ${CMAJOR} " == " 24" ]]; then
77
+ install_from_rpm " fedora24"
75
78
elif [[ " ${LSB_DISTRO} " == " ubuntu" ]]; then
76
79
check_deps
77
80
install_from_deb " ubuntu"
@@ -438,7 +441,7 @@ install_from_rpm(){
438
441
handle_hyper_rpm_rename
439
442
${BASH_C} " yum ${_ACT} -y ${S3_URL} /${CENTOS7_QEMU_HYPER} .rpm ${S3_URL} /${CENTOS7_HYPERSTART} .rpm ${S3_URL} /${CENTOS7_HYPER} .rpm"
440
443
;;
441
- fedora23)
444
+ fedora23|fedora24 )
442
445
rpm -qa | grep ${FC23_HYPER} > /dev/null 2>&1
443
446
if [[ $? -eq 0 ]]; then
444
447
show_message info " ${ERR_HYPER_NO_NEW_VERSION[1]} " ; exit 1
@@ -458,6 +461,15 @@ install_from_rpm(){
458
461
install_from_deb (){
459
462
show_message info " Fetch deb package for $1 ...\n"
460
463
set +e
464
+ local USE_WGET=$( echo $( get_curl) | awk -F" |" ' {print $1}' )
465
+ local CURL_C=$( echo $( get_curl) | awk -F" |" ' {print $2}' )
466
+ LIBVIRT0=` dpkg -s libvirt0 2> /dev/null| grep Version| wc -l`
467
+ if [ ${LIBVIRT0} -eq 0 ]; then
468
+ show_message info " hypercontainer depends on libvirt0(1.2.16-2+), start install libvirt0...\n"
469
+ show_message error " ${ERR_LIBVIRT_NOT_INSTALL[1]} "
470
+ exit ${ERR_LIBVIRT_NOT_INSTALL[0]}
471
+ fi
472
+
461
473
${BASH_C} " ping -c 3 -W 2 hypercontainer-install.s3.amazonaws.com >/dev/null 2>&1"
462
474
if [[ $? -ne 0 ]]; then
463
475
S3_URL=" http://mirror-hypercontainer-install.s3.amazonaws.com"
@@ -475,8 +487,13 @@ install_from_deb(){
475
487
else
476
488
_ACT=" install"
477
489
fi
478
- ${BASH_C} " wget -q -O /tmp/${DEBIAN_HYPERSTART} .deb ${S3_URL} /${DEBIAN_HYPERSTART} .deb && dpkg -i /tmp/${DEBIAN_HYPERSTART} .deb"
479
- ${BASH_C} " wget -q -O /tmp/${DEBIAN_HYPER} .deb ${S3_URL} /${DEBIAN_HYPER} .deb && dpkg -i /tmp/${DEBIAN_HYPER} .deb"
490
+ if [[ " ${USE_WGET} " == " true" ]]; then
491
+ ${BASH_C} " ${CURL_C} -O /tmp/${DEBIAN_HYPERSTART} .deb ${S3_URL} /${DEBIAN_HYPERSTART} .deb && dpkg -i /tmp/${DEBIAN_HYPERSTART} .deb"
492
+ ${BASH_C} " ${CURL_C} -O /tmp/${DEBIAN_HYPER} .deb ${S3_URL} /${DEBIAN_HYPER} .deb && dpkg -i /tmp/${DEBIAN_HYPER} .deb"
493
+ else
494
+ ${BASH_C} " ${CURL_C} /tmp/${DEBIAN_HYPERSTART} .deb ${S3_URL} /${DEBIAN_HYPERSTART} .deb && dpkg -i /tmp/${DEBIAN_HYPERSTART} .deb"
495
+ ${BASH_C} " ${CURL_C} /tmp/${DEBIAN_HYPER} .deb ${S3_URL} /${DEBIAN_HYPER} .deb && dpkg -i /tmp/${DEBIAN_HYPER} .deb"
496
+ fi
480
497
;;
481
498
* ) show_message error " deb install support debian & ubuntu only" ; exit 1;;
482
499
esac
0 commit comments