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

Commit 94f4df6

Browse files
committed
update hypercontainer package
1. update package names to match 0.6 release 2. hyper command line is renamed to hyperctl Signed-off-by: Peng Tao <bergwolf@gmail.com>
1 parent d5d2564 commit 94f4df6

File tree

1 file changed

+24
-15
lines changed

1 file changed

+24
-15
lines changed

hyper-bootstrap.sh

Lines changed: 24 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
#!/bin/bash
2-
# Description: This script is used to install hyper cli and hyperd
2+
# Description: This script is used to install hyperctl and hyperd
33
# Usage:
44
# install from remote
55
# wget -qO- http://hypercontainer.io/install | bash
@@ -20,10 +20,10 @@ UNTAR_DIR="hyper-pkg"
2020
SUPPORT_EMAIL="support@hyper.sh"
2121
############ RPM ##############
2222
CENTOS7_QEMU_HYPER="qemu-hyper-2.4.1-2.el7.centos.x86_64"
23-
CENTOS7_HYPERSTART="hyperstart-0.5-1.el7.centos.x86_64"
24-
CENTOS7_HYPER="hyper-0.5-1.el7.centos.x86_64"
25-
FC23_HYPERSTART="hyperstart-0.5-1.fc23.x86_64"
26-
FC23_HYPER="hyper-0.5-1.fc23.x86_64"
23+
CENTOS7_HYPERSTART="hyperstart-0.6-1.el7.centos.x86_64"
24+
CENTOS7_HYPER="hyper-container-0.6-1.el7.centos.x86_64"
25+
FC23_HYPERSTART="hyperstart-0.6-1.fc23.x86_64"
26+
FC23_HYPER="hyper-container-0.6-1.fc23.x86_64"
2727
########## Constant ##########
2828
SUPPORT_DISTRO=(debian ubuntu fedora centos linuxmint)
2929
LINUX_MINT_CODE=(rafaela rebecca qiana)
@@ -61,7 +61,7 @@ ERR_UNKNOWN_MSG_TYPE=98
6161
ERR_UNKNOWN=99
6262
########## Function Definition ##########
6363
main() {
64-
show_message info "Welcome to Install Community Edition of Hyper...\n"
64+
show_message info "Welcome to Install Community Edition of HyperContainer...\n"
6565
check_user
6666
check_os_platform
6767
check_os_distro
@@ -86,10 +86,10 @@ main() {
8686
exit 0
8787
}
8888
check_hyper_before_install() {
89-
if (command_exist hyper hyperd);then
89+
if (command_exist hyperctl hyperd);then
9090
echo "${WHITE}"
9191
cat <<COMMENT
92-
Prompt: "hyper" appears to already installed, hyperd serive will be restart during install.
92+
Prompt: "hyper-container" appears to already installed, hyperd serive will be restart during install.
9393
You may press Ctrl+C to abort this process.
9494
COMMENT
9595
echo -e -n "+ sleep ${SLEEP_SEC} seconds${RESET}"
@@ -316,11 +316,11 @@ install_hyper() {
316316
show_message error "${ERR_EXEC_INSTALL_FAILED[1]}" && exit "${ERR_EXEC_INSTALL_FAILED[0]}"
317317
fi
318318
echo -n "."
319-
if [[ -f /usr/local/bin/hyper ]] && [[ -f /usr/local/bin/hyperd ]] && [[ ! -f /usr/bin/hyper ]] && [[ ! -f /usr/bin/hyperd ]] ;then
320-
${BASH_C} "ln -s /usr/local/bin/hyper /usr/bin/hyper"
319+
if [[ -f /usr/local/bin/hyperctl ]] && [[ -f /usr/local/bin/hyperd ]] && [[ ! -f /usr/bin/hyperctl ]] && [[ ! -f /usr/bin/hyperd ]] ;then
320+
${BASH_C} "ln -s /usr/local/bin/hyperctl /usr/bin/hyperctl"
321321
${BASH_C} "ln -s /usr/local/bin/hyperd /usr/bin/hyperd"
322322
fi
323-
if (command_exist hyper hyperd);then
323+
if (command_exist hyperctl hyperd);then
324324
install_hyperd_service
325325
echo -n "."
326326
else
@@ -382,8 +382,8 @@ start_hyperd_service() {
382382
show_message success "\nhyperd is running."
383383
cat <<COMMENT
384384
----------------------------------------------------
385-
To see how to use hyper cli:
386-
sudo hyper help
385+
To see how to use hyperctl:
386+
sudo hyperctl help
387387
To manage hyperd service:
388388
sudo service hyperd {start|stop|restart|status}
389389
To get more information:
@@ -399,6 +399,13 @@ COMMENT
399399
fi
400400
set -e
401401
}
402+
handle_hyper_rpm_rename(){
403+
if (command_exist hyper hyperd && ! command_exist hyperctl);then
404+
${BASH_C} "cp -f /etc/hyper/config /etc/hyper/config.rpmsave"
405+
${BASH_C} "yum remove -y hyper hyperstart"
406+
${BASH_C} "cp -f /etc/hyper/config.rpmsave /etc/hyper/config"
407+
fi
408+
}
402409
install_from_rpm(){
403410
show_message info "Fetch rpm package for $1...\n"
404411
set +e
@@ -414,23 +421,25 @@ install_from_rpm(){
414421
if [ $? -eq 0 ];then
415422
show_message info "${ERR_HYPER_NO_NEW_VERSION[1]}"; exit 1
416423
fi
417-
if (command_exist hyper hyperd);then
424+
if (command_exist hyperctl hyperd);then
418425
_ACT="update"
419426
else
420427
_ACT="install"
421428
fi
429+
handle_hyper_rpm_rename
422430
${BASH_C} "yum ${_ACT} -y ${S3_URL}/${CENTOS7_QEMU_HYPER}.rpm ${S3_URL}/${CENTOS7_HYPERSTART}.rpm ${S3_URL}/${CENTOS7_HYPER}.rpm"
423431
;;
424432
fedora23)
425433
rpm -qa | grep ${FC23_HYPER} > /dev/null 2>&1
426434
if [ $? -eq 0 ];then
427435
show_message info "${ERR_HYPER_NO_NEW_VERSION[1]}"; exit 1
428436
fi
429-
if (command_exist hyper hyperd);then
437+
if (command_exist hyperctl hyperd);then
430438
_ACT="update"
431439
else
432440
_ACT="install"
433441
fi
442+
handle_hyper_rpm_rename
434443
${BASH_C} "dnf ${_ACT} ${S3_URL}/${FC23_HYPERSTART}.rpm ${S3_URL}/${FC23_HYPER}.rpm"
435444
;;
436445
*) show_message error "rpm install support centos7 & fedora23 only"; exit 1;;

0 commit comments

Comments
 (0)