Update install.sh

(Improved message reading)
This commit is contained in:
Antho 2022-05-05 20:04:55 +00:00
parent 3f21aaeaf9
commit b00c5ee19f

View File

@ -11,8 +11,8 @@ White='\033[0;37m'
NORMAL=$(tput sgr0) NORMAL=$(tput sgr0)
if [ $(id -u) != 0 ] ; then if [ $(id -u) != 0 ] ; then
echo "Super-user (root) rights are required to install " echo "${Red}Super-user (root) rights are required to install${NORMAL}"
echo "Please run 'sudo $0' or login as root, then restart $0" echo "${Red}Please run 'sudo $0' or login as root, then restart $0${NORMAL}"
exit 1 exit 1
fi fi
@ -26,6 +26,7 @@ apt_install() {
step_1_upgrade() { step_1_upgrade() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 1 Update and base pakage${NORMAL}" echo "${Yellow}Starting step 1 Update and base pakage${NORMAL}"
echo ""
apt update apt update
apt upgrade -y apt upgrade -y
apt install -y curl apt install -y curl
@ -36,6 +37,7 @@ step_1_upgrade() {
step_2_node_install() { step_2_node_install() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 2 Node v14 install${NORMAL}" echo "${Yellow}Starting step 2 Node v14 install${NORMAL}"
echo ""
curl -fsSL https://deb.nodesource.com/setup_14.x | bash - curl -fsSL https://deb.nodesource.com/setup_14.x | bash -
apt install -y nodejs apt install -y nodejs
echo "${Green}Step 2 completed${NORMAL}" echo "${Green}Step 2 completed${NORMAL}"
@ -44,6 +46,7 @@ step_2_node_install() {
step_3_yarn_install() { step_3_yarn_install() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 3 Yarn install${NORMAL}" echo "${Yellow}Starting step 3 Yarn install${NORMAL}"
echo ""
npm install --global yarn npm install --global yarn
echo "${Green}Step 3 completed${NORMAL}" echo "${Green}Step 3 completed${NORMAL}"
} }
@ -51,6 +54,7 @@ step_3_yarn_install() {
step_4_packages_install() { step_4_packages_install() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 4 XO packages install${NORMAL}" echo "${Yellow}Starting step 4 XO packages install${NORMAL}"
echo ""
apt install -y build-essential apt install -y build-essential
apt install -y redis-server apt install -y redis-server
apt install -y libpng-dev apt install -y libpng-dev
@ -65,6 +69,7 @@ step_4_packages_install() {
step_5_fetching_xo_code() { step_5_fetching_xo_code() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 5 fetching the XO code${NORMAL}" echo "${Yellow}Starting step 5 fetching the XO code${NORMAL}"
echo ""
git clone -b master https://github.com/vatesfr/xen-orchestra git clone -b master https://github.com/vatesfr/xen-orchestra
echo "${Green}Step 5 completed${NORMAL}" echo "${Green}Step 5 completed${NORMAL}"
} }
@ -72,6 +77,7 @@ step_5_fetching_xo_code() {
step_6_dependencies_install() { step_6_dependencies_install() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 6 Dependency install${NORMAL}" echo "${Yellow}Starting step 6 Dependency install${NORMAL}"
echo ""
cd xen-orchestra cd xen-orchestra
yarn yarn
yarn build yarn build
@ -84,6 +90,7 @@ step_6_dependencies_install() {
step_7_xo_running() { step_7_xo_running() {
echo "---------------------------------------------------------------------" echo "---------------------------------------------------------------------"
echo "${Yellow}Starting step 7 running XO${NORMAL}" echo "${Yellow}Starting step 7 running XO${NORMAL}"
echo ""
yarn start yarn start
echo "${Green}Step 7 completed${NORMAL}" echo "${Green}Step 7 completed${NORMAL}"
} }