Clearly outlined all logic, fixed errors, asks about Docker

This commit is contained in:
Marwolf
2018-07-14 20:22:24 -04:00
parent b24d672231
commit 47237f048f

View File

@@ -4,6 +4,7 @@ RED=`tput setaf 1`
GREEN=`tput setaf 2` GREEN=`tput setaf 2`
NC=`tput sgr0` # No Color NC=`tput sgr0` # No Color
# Install Choice ===================================================>
echo "${RED}Open RSC Installer:${NC} echo "${RED}Open RSC Installer:${NC}
An easy to run RSC private server environment using Docker magic. An easy to run RSC private server environment using Docker magic.
@@ -15,6 +16,8 @@ Choices:
${RED}2${NC} - Im all set, continue! (default)" ${RED}2${NC} - Im all set, continue! (default)"
echo "" echo ""
read install read install
# OS Selection ===================================================>
if [ "$install" == "1" ]; then if [ "$install" == "1" ]; then
clear clear
echo "Which operating system are you running?" echo "Which operating system are you running?"
@@ -25,10 +28,11 @@ if [ "$install" == "1" ]; then
echo "${RED}4${NC} - Other" echo "${RED}4${NC} - Other"
echo "" echo ""
read os read os
if [ "$os" == "1" ]; then
# Ubuntu OS ===================================================>
if [ "$os" == "1" ]; then
echo "" echo ""
echo "Which Ubuntu version are you running?" echo "Which Ubuntu Linux version are you running?"
echo "" echo ""
echo "${RED}1${NC} - 16.04" echo "${RED}1${NC} - 16.04"
echo "${RED}2${NC} - 16.10" echo "${RED}2${NC} - 16.10"
@@ -38,6 +42,8 @@ if [ "$install" == "1" ]; then
echo "${RED}6${NC} - 18.10" echo "${RED}6${NC} - 18.10"
echo "" echo ""
read ubuntu read ubuntu
# Ubuntu Version ===================================================>
if [ "$ubuntu" == "1" ]; then if [ "$ubuntu" == "1" ]; then
vers="xenial" vers="xenial"
elif [ "$ubuntu" == "2" ]; then elif [ "$ubuntu" == "2" ]; then
@@ -54,12 +60,30 @@ if [ "$install" == "1" ]; then
vers="bionic" vers="bionic"
continue continue
fi fi
echo "Attempting to install Docker now" # UBUNTU Version <===================================================
echo "" echo ""
sudo apt update && sudo apt install git build-essential apt-transport-https ca-certificates curl software-properties-common -y echo ""
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - echo "Do you have Docker installed?"
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $vers stable" echo ""
sudo apt update && sudo apt install docker-ce docker-compose -y echo "${RED}1${NC} - No, install it for me!"
echo "${RED}2${NC} - Yes"
echo ""
read docker
# Ubuntu Docker ===================================================>
if [ "$docker" == "1" ]; then
echo "Attempting to install Docker now"
echo ""
sudo apt update && sudo apt install git build-essential apt-transport-https ca-certificates curl software-properties-common -y
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $vers stable"
sudo apt update && sudo apt install docker-ce docker-compose -y
else
continue
fi
# Ubuntu Docker <===================================================
echo "" echo ""
echo "" echo ""
echo "Do you have Java OpenJDK installed already?" echo "Do you have Java OpenJDK installed already?"
@@ -68,13 +92,19 @@ if [ "$install" == "1" ]; then
echo "${RED}2${NC} - Im all set" echo "${RED}2${NC} - Im all set"
echo "" echo ""
read java read java
# Ubuntu Java ===================================================>
if [ "$java" == "1" ]; then if [ "$java" == "1" ]; then
sudo apt update && sudo apt install default-jdk ant openjfx -y sudo apt update && sudo apt install default-jdk ant openjfx -y
else else
continue continue
fi fi
# Ubuntu Java <===================================================
# Ubuntu OS <===================================================
# Fedora OS ===================================================>
elif [ "$os" == "2" ]; then elif [ "$os" == "2" ]; then
su -c "yum update && yum install git" su -c 'yum update && yum install git'
echo "" echo ""
echo "" echo ""
echo "Do you have Java OpenJDK installed already?" echo "Do you have Java OpenJDK installed already?"
@@ -83,17 +113,38 @@ if [ "$install" == "1" ]; then
echo "${RED}2${NC} - Im all set" echo "${RED}2${NC} - Im all set"
echo "" echo ""
read java read java
# Fedora Java ===================================================>
if [ "$java" == "1" ]; then if [ "$java" == "1" ]; then
yum install alternatives su -c 'yum install alternatives'
/usr/sbin/alternatives --config java su -c '/usr/sbin/alternatives --config java'
else else
continue continue
fi fi
# Fedora Java <===================================================
echo "" echo ""
echo "" echo ""
echo "Attempting to install Docker now" echo "Do you have Docker installed?"
curl -fsSL get.docker.com -o get-docker.sh echo ""
sudo sh get-docker.sh echo "${RED}1${NC} - No, install it for me!"
echo "${RED}2${NC} - Yes"
echo ""
read docker
# Fedora Docker ===================================================>
if [ "$docker" == "1" ]; then
echo "Attempting to install Docker now"
echo ""
curl -fsSL get.docker.com -o get-docker.sh
su -c 'sh get-docker.sh'
else
continue
fi
# Fedora Docker <===================================================
# Fedora OS <===================================================
# Mac OS ===================================================>
elif [ "$os" == "3" ]; then elif [ "$os" == "3" ]; then
clear clear
echo "Do you have brew installed?" echo "Do you have brew installed?"
@@ -102,80 +153,106 @@ if [ "$install" == "1" ]; then
echo "${RED}2${NC} - Yes" echo "${RED}2${NC} - Yes"
echo "" echo ""
read brew read brew
# Mac Brew ===================================================>
if [ "$brew" == "1" ]; then if [ "$brew" == "1" ]; then
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)" /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
brew install git brew install git
echo ""
echo ""
echo "Do you have Java OpenJDK 8 installed already?"
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
echo ""
read java
if [ "$java" == "1" ]; then
brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk-openjdk8
else
continue
fi
echo ""
echo ""
echo "Do you have Docker installed?"
echo ""
echo "${RED}1${NC} - No, install it for me!"
echo "${RED}2${NC} - Yes"
echo ""
read docker
if [ "$docker" == "1" ]; then
echo "Downloading the Docker for Mac installer"
brew install wget
wget https://download.docker.com/mac/stable/Docker.dmg
hdiutil attach Docker.dmg
echo ""
echo "Please drag Docker as instructed in the popup."
echo ""
echo "Press enter when finished."
echo ""
read
echo ""
open /Applications/Docker.app
echo ""
echo "Docker is launching. Please follow the directions that it gives you."
echo ""
echo "Press enter when finished."
echo ""
read
else
continue
fi
else
echo ""
echo ""
echo "Do you have Java OpenJDK 8 installed already?"
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
echo ""
read java
if [ "$java" == "1" ]; then
brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk-openjdk8
else
continue
fi
continue
fi fi
# Mac Brew <===================================================
echo ""
echo ""
echo "Do you have Java OpenJDK 8 installed already?"
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
echo ""
read java
# Mac Java ===================================================>
if [ "$java" == "1" ]; then
brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk-openjdk8
fi
# Mac Java <===================================================
echo ""
echo ""
echo "Do you have Docker installed?"
echo ""
echo "${RED}1${NC} - No, install it for me!"
echo "${RED}2${NC} - Yes"
echo ""
read docker
# Mac Docker ===================================================>
if [ "$docker" == "1" ]; then
echo "Downloading the Docker for Mac installer"
brew install wget
wget https://download.docker.com/mac/stable/Docker.dmg
hdiutil attach Docker.dmg
echo ""
echo "Please drag Docker as instructed in the popup."
echo ""
echo "Press enter when finished."
echo ""
read
echo ""
open /Applications/Docker.app
echo ""
echo "Docker is launching. Please follow the directions that it gives you."
echo ""
echo "Press enter when finished."
echo ""
read
fi
# Mac Docker <===================================================
echo ""
echo ""
echo "Do you have Java OpenJDK 8 installed already?"
echo ""
echo "${RED}1${NC} - Install for me!"
echo "${RED}2${NC} - Im all set"
echo ""
read java
# Mac Java ===================================================>
if [ "$java" == "1" ]; then
brew tap AdoptOpenJDK/openjdk
brew install adoptopenjdk-openjdk8
else
continue
fi
# Mac Java <===================================================
# Mac OS <===================================================
# Other OS ===================================================>
elif [ "$os" == "4" ]; then elif [ "$os" == "4" ]; then
echo "" echo ""
echo "You will have to install Git manually then. Press enter to continue." echo "You will have to install Git manually then. Press enter to continue."
echo "" echo ""
read read
echo "" echo ""
echo "Attempting to install Docker now" echo "Do you have Docker installed?"
echo "" echo ""
curl -fsSL get.docker.com -o get-docker.sh echo "${RED}1${NC} - No, install it for me!"
sudo sh get-docker.sh echo "${RED}2${NC} - Yes"
echo ""
read docker
# Other OS Docker ===================================================>
if [ "$docker" == "1" ]; then
echo "Attempting to install Docker now"
echo ""
curl -fsSL get.docker.com -o get-docker.sh
sudo sh get-docker.sh
else
continue
fi
# Other OS Docker <===================================================
echo "" echo ""
echo "" echo ""
echo "Do you have Java OpenJDK installed already?" echo "Do you have Java OpenJDK installed already?"
@@ -184,17 +261,25 @@ if [ "$install" == "1" ]; then
echo "${RED}2${NC} - Im all set" echo "${RED}2${NC} - Im all set"
echo "" echo ""
read java read java
# Other OS Java ===================================================>
if [ "$java" == "1" ]; then if [ "$java" == "1" ]; then
sudo apt update && sudo apt install default-jdk ant openjfx -y sudo apt update && sudo apt install default-jdk ant openjfx -y
else else
continue continue
fi fi
# Other OS Java <===================================================
# Other OS <===================================================
else else
continue continue
fi fi
# OS Selection <===================================================
else else
continue continue
fi fi
# Install Choice <===================================================
clear clear
echo "Checking the Docker Home git repo for any recent updates." echo "Checking the Docker Home git repo for any recent updates."
@@ -213,6 +298,9 @@ Choices:
Which of the above do you want? Type 1, 2, or 3, and press enter." Which of the above do you want? Type 1, 2, or 3, and press enter."
echo "" echo ""
read choice read choice
# Selection ===================================================>
# 1. Single player RSC game ===================================================>
if [ "$choice" == "1" ]; then if [ "$choice" == "1" ]; then
clear clear
echo "You have picked ${GREEN}single player RSC + PHPMyAdmin!${NC}" echo "You have picked ${GREEN}single player RSC + PHPMyAdmin!${NC}"
@@ -257,6 +345,9 @@ if [ "$choice" == "1" ]; then
echo "Open RSC setup complete!" echo "Open RSC setup complete!"
echo "" echo ""
exit exit
# 1. Single player RSC game <===================================================
# 2. Game + Website + PHPMyAdmin ===================================================>
elif [ "$choice" == "2" ]; then elif [ "$choice" == "2" ]; then
clear clear
echo "You have picked ${GREEN}Game + Website + PHPMyAdmin!${NC}" echo "You have picked ${GREEN}Game + Website + PHPMyAdmin!${NC}"
@@ -305,6 +396,9 @@ elif [ "$choice" == "2" ]; then
echo "Open RSC setup complete!" echo "Open RSC setup complete!"
echo "" echo ""
exit exit
# 2. Game + Website + PHPMyAdmin <===================================================
# 3. Game + Website + PHPMyAdmin + RSC Preservation Wiki ===================================================>
elif [ "$choice" == "3" ]; then elif [ "$choice" == "3" ]; then
clear clear
echo "You have picked ${GREEN}Game + Website + PHPMyAdmin + RSC Preservation Wiki!${NC}" echo "You have picked ${GREEN}Game + Website + PHPMyAdmin + RSC Preservation Wiki!${NC}"
@@ -364,6 +458,8 @@ elif [ "$choice" == "3" ]; then
echo "Open RSC setup complete!" echo "Open RSC setup complete!"
echo "" echo ""
exit exit
# 3. Game + Website + PHPMyAdmin + RSC Preservation Wiki <===================================================
else else
echo "" echo ""
echo "Error! ${RED}$choice${NC} is not a valid option. Press enter to try again." echo "Error! ${RED}$choice${NC} is not a valid option. Press enter to try again."
@@ -371,3 +467,4 @@ else
read read
./Setup_Linux_Mac.sh ./Setup_Linux_Mac.sh
fi fi
# Selection <===================================================