Compare commits
No commits in common. "dev" and "main" have entirely different histories.
74
install.sh
74
install.sh
|
@ -16,42 +16,14 @@ if [ $(id -u) != 0 ] ; then
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Menu for script
|
apt_install() {
|
||||||
echo ""
|
|
||||||
echo "${Purple}Welcome to XO installer by Antho${NORMAL}"
|
|
||||||
echo "${Purple}XO version : from sources${NORMAL}"
|
|
||||||
echo "${Purple}XO folder : xen-orchestra/packages/xo-server${NORMAL}"
|
|
||||||
echo ""
|
|
||||||
echo "SELECT YOUR FAVORITE FRUIT";
|
|
||||||
echo "1. Install"
|
|
||||||
echo "2. Update"
|
|
||||||
echo "9. Exit"
|
|
||||||
echo -n "Enter your choice [1-9]: "
|
|
||||||
|
|
||||||
while :
|
|
||||||
do
|
|
||||||
read choice
|
|
||||||
|
|
||||||
case $choice in
|
|
||||||
|
|
||||||
# Install
|
|
||||||
1) apt_install() {
|
|
||||||
if [ $? -ne 0 ]; then
|
if [ $? -ne 0 ]; then
|
||||||
echo "${Red}Cannot install $@ - Cancellation${NORMAL}"
|
echo "${Red}Cannot install $@ - Cancellation${NORMAL}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
STEP=0
|
step_1_upgrade() {
|
||||||
|
|
||||||
# Exit
|
|
||||||
9) echo "Bye ..."
|
|
||||||
exit;;
|
|
||||||
# Default
|
|
||||||
*) echo "invalid option";;
|
|
||||||
|
|
||||||
|
|
||||||
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 ""
|
echo ""
|
||||||
|
@ -61,9 +33,9 @@ case $choice in
|
||||||
apt install -y npm
|
apt install -y npm
|
||||||
echo "${Green}Step 1 completed${NORMAL}"
|
echo "${Green}Step 1 completed${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
step_2_node_install() {
|
step_2_node_install() {
|
||||||
echo "---------------------------------------------------------------------"
|
echo "---------------------------------------------------------------------"
|
||||||
echo "${Yellow}Starting step 2 Node v16 install${NORMAL}"
|
echo "${Yellow}Starting step 2 Node v16 install${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
|
@ -71,18 +43,18 @@ case $choice in
|
||||||
apt install -y nodejs
|
apt install -y nodejs
|
||||||
echo "${Green}Step 2 completed${NORMAL}"
|
echo "${Green}Step 2 completed${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ""
|
echo ""
|
||||||
npm install --global yarn
|
npm install --global yarn
|
||||||
echo "${Green}Step 3 completed${NORMAL}"
|
echo "${Green}Step 3 completed${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ""
|
echo ""
|
||||||
|
@ -96,18 +68,18 @@ case $choice in
|
||||||
apt install -y cifs-utils
|
apt install -y cifs-utils
|
||||||
echo "${Green}Step 4 completed${NORMAL}"
|
echo "${Green}Step 4 completed${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ""
|
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}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ""
|
echo ""
|
||||||
|
@ -119,9 +91,9 @@ case $choice in
|
||||||
cp sample.config.toml ~/.config/xo-server/config.toml
|
cp sample.config.toml ~/.config/xo-server/config.toml
|
||||||
echo "${VERT}Step 6 completed${NORMAL}"
|
echo "${VERT}Step 6 completed${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
}
|
}
|
||||||
|
|
||||||
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 ""
|
echo ""
|
||||||
|
@ -132,18 +104,16 @@ case $choice in
|
||||||
service orchestra start
|
service orchestra start
|
||||||
echo "${Green}Step 7 completed${NORMAL}"
|
echo "${Green}Step 7 completed${NORMAL}"
|
||||||
echo ""
|
echo ""
|
||||||
};;
|
}
|
||||||
|
|
||||||
2) echo " Update in progress";;
|
|
||||||
|
|
||||||
# Pattern 4
|
|
||||||
4) echo "Quiting ..."
|
|
||||||
exit;;
|
|
||||||
# Default Pattern
|
|
||||||
*) echo "invalid option";;
|
|
||||||
|
|
||||||
|
|
||||||
|
STEP=0
|
||||||
|
|
||||||
|
echo ""
|
||||||
|
echo "${Purple}Welcome to XO installer by Antho${NORMAL}"
|
||||||
|
echo "${Purple}XO version : from sources${NORMAL}"
|
||||||
|
echo "${Purple}XO folder : xen-orchestra/packages/xo-server${NORMAL}"
|
||||||
|
echo ""
|
||||||
|
|
||||||
case ${STEP} in
|
case ${STEP} in
|
||||||
0)
|
0)
|
||||||
|
|
Loading…
Reference in New Issue
Block a user