No verbose output

This commit is contained in:
Marwolf
2018-08-21 12:40:34 -04:00
parent 1fdab10593
commit 57f6646045
5 changed files with 98 additions and 156 deletions

View File

@@ -5,14 +5,12 @@ source .env
# Check for any updates to the game server # Check for any updates to the game server
clear clear
echo "Pulling recent updates from the Open-RSC Game repository." echo "Pulling recent updates from the Open-RSC Game repository."
echo ""
echo ""
cd Game cd Game
sudo git pull sudo git pull &>/dev/null
echo ""
# Verifies permissions are set correctly # Verifies permissions are set correctly
sudo chmod -R 777 Game sudo chmod -R 777 Game &>/dev/null
sudo setfacl -m user:$USER:rw /var/run/docker.sock sudo setfacl -m user:$USER:rw /var/run/docker.sock &>/dev/null
cd .. cd ..
clear clear
@@ -22,8 +20,6 @@ echo "${RED}1${NC} - Yes, lets begin."
echo "${RED}2${NC} - No, continue." echo "${RED}2${NC} - No, continue."
echo "" echo ""
echo "Which of the above do you wish to do? Type the choice number and press enter." echo "Which of the above do you wish to do? Type the choice number and press enter."
echo ""
echo ""
read edit read edit
if [ "$edit" == "1" ]; then if [ "$edit" == "1" ]; then
@@ -33,7 +29,10 @@ sudo nano Game/client/src/org/openrsc/client/Config.java
sudo nano Game/Launcher/src/Main.java sudo nano Game/Launcher/src/Main.java
sudo nano Game/server/config/config.xml sudo nano Game/server/config/config.xml
sudo nano etc/ghost/config.production.json sudo nano etc/ghost/config.production.json
sudo make stop && sudo make start
clear
echo "Restarting Ghost container"
sudo docker stop ghost && sudo docker start ghost &>/dev/null
fi fi
if [ "$edit" == "2" ]; then if [ "$edit" == "2" ]; then
@@ -43,41 +42,38 @@ fi
# Server # Server
cd Game cd Game
clear clear
echo "Preparing the game server." echo "Compiling the game server. Any errors will be in compile.log"
echo "" touch ../compile.log && chmod 777 ../compile.log &>/dev/null
sudo ant -f "server/build.xml" compile sudo ant -f "server/build.xml" compile | tee ../compile.log &>/dev/null
# Client # Client
clear clear
echo "Preparing the game client." echo "Compiling and preparing the game client. Any errors will be in compile.log"
echo "" sudo ant -f "client/build.xml" compile | tee -a ../compile.log &>/dev/null
sudo ant -f "client/build.xml" compile
cd client cd client
sudo zip -r "client.zip" "Open_RSC_Client.jar" sudo zip -r "client.zip" "Open_RSC_Client.jar" &>/dev/null
cd ../ cd ../
yes | sudo cp -rf "client/client.zip" "../Website/downloads/" yes | sudo cp -rf "client/client.zip" "../Website/downloads/" &>/dev/null
sudo rm "client/client.zip" sudo rm "client/client.zip" &>/dev/null
# Launcher # Launcher
clear clear
echo "Preparing the game launcher." echo "Compiling and preparing the game launcher. Any errors will be in compile.log"
echo "" sudo ant -f "Launcher/build.xml" jar | tee -a ../compile.log &>/dev/null
sudo ant -f "Launcher/build.xml" jar yes | sudo cp -rf "Launcher/dist/Open_RSC_Launcher.jar" "../Website/downloads/" &>/dev/null
yes | sudo cp -rf "Launcher/dist/Open_RSC_Launcher.jar" "../Website/downloads/"
# Cache # Cache
clear clear
echo "Preparing the cache." echo "Preparing the cache."
yes | sudo cp -rf "client/cache.zip" "../Website/downloads/" yes | sudo cp -rf "client/cache.zip" "../Website/downloads/" &>/dev/null
cd .. cd ..
sudo rm Website/downloads/hashes.txt sudo rm Website/downloads/hashes.txt &>/dev/null
md5sum Website/downloads/client.zip | grep ^[a-zA-Z0-9]* | awk '{print "client="$1}' | sudo tee -a Website/downloads/hashes.txt md5sum Website/downloads/client.zip | grep ^[a-zA-Z0-9]* | awk '{print "client="$1}' | sudo tee -a Website/downloads/hashes.txt &>/dev/null
md5sum Website/downloads/cache.zip | grep ^[a-zA-Z0-9]* | awk '{print "cache="$1}' | sudo tee -a Website/downloads/hashes.txt md5sum Website/downloads/cache.zip | grep ^[a-zA-Z0-9]* | awk '{print "cache="$1}' | sudo tee -a Website/downloads/hashes.txt &>/dev/null
# Database # Database
clear clear
echo "Preparing the database." echo "Preparing the database."
echo ""
docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" < Game/Databases/openrsc_config.sql 2>/dev/null docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" < Game/Databases/openrsc_config.sql 2>/dev/null
# Run the game server in a detached screen # Run the game server in a detached screen

View File

@@ -16,8 +16,6 @@ Choices:
${RED}2${NC} - No thanks, continue (default)" ${RED}2${NC} - No thanks, continue (default)"
echo "" echo ""
echo "Which of the above do you wish to do? Type the choice number and press enter." echo "Which of the above do you wish to do? Type the choice number and press enter."
echo ""
echo ""
read install read install
# OS Selection ===================================================> # OS Selection ===================================================>
@@ -29,8 +27,6 @@ if [ "$install" == "1" ]; then
echo "${RED}2${NC} - Mac OS High Sierra or above" echo "${RED}2${NC} - Mac OS High Sierra or above"
echo "" echo ""
echo "Which of the above do you wish to do? Type the choice number and press enter." echo "Which of the above do you wish to do? Type the choice number and press enter."
echo ""
echo ""
read os read os
# Ubuntu OS ===================================================> # Ubuntu OS ===================================================>
@@ -39,42 +35,36 @@ if [ "$install" == "1" ]; then
sudo dpkg-reconfigure tzdata sudo dpkg-reconfigure tzdata
clear clear
echo "Verifying the basics are installed." echo "Verifying the basics are installed. Please wait."
echo "" sudo apt-get update &>/dev/null
sudo apt-get update sudo apt-get install software-properties-common -y &>/dev/null
sudo apt-get install software-properties-common -y sudo add-apt-repository ppa:certbot/certbot -y &>/dev/null
sudo add-apt-repository ppa:certbot/certbot -y sudo apt-get update &>/dev/null
sudo apt-get update sudo apt-get install certbot screen zip fail2ban unzip git build-essential apt-transport-https ca-certificates curl software-properties-common -y &>/dev/null
sudo apt-get install certbot screen zip fail2ban unzip git build-essential apt-transport-https ca-certificates curl software-properties-common -y
clear clear
echo "Attempting to install Docker now" echo "Attempting to install Docker now."
echo "" curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - &>/dev/null
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 bionic stable" &>/dev/null
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable" sudo apt-get update &>/dev/null && sudo apt-get install docker-ce docker-compose -y &>/dev/null
sudo apt-get update && sudo apt-get install docker-ce docker-compose -y
clear clear
echo "Setting Docker to have the correct storage driver and reloading service." echo "Setting Docker to have the correct storage driver and reloading service."
echo ""
echo '{ echo '{
"storage-driver": "devicemapper" "storage-driver": "devicemapper"
}' | sudo tee /etc/docker/daemon.json && sudo service docker restart }' | sudo tee /etc/docker/daemon.json && sudo service docker restart &>/dev/null
clear clear
echo "Configuring UFW." echo "Configuring UFW."
echo "" sudo ufw allow 22/tcp &>/dev/null && sudo ufw allow 80/tcp &>/dev/null && sudo ufw allow 8080/tcp &>/dev/null && sudo ufw allow 443/tcp &>/dev/null && sudo ufw allow 9000/tcp &>/dev/null && sudo ufw allow 53595/tcp &>/dev/null && sudo ufw deny 3306/tcp &>/dev/null
sudo ufw allow 22/tcp && sudo ufw allow 80/tcp && sudo ufw allow 8080/tcp && sudo ufw allow 443/tcp && sudo ufw allow 9000/tcp && sudo ufw allow 53595/tcp && sudo ufw deny 3306/tcp sudo sed -i 's/DEFAULT_FORWARD_POLICY="DENY"/DEFAULT_FORWARD_POLICY="ACCEPT"/g' /etc/default/ufw &>/dev/null
sudo sed -i 's/DEFAULT_FORWARD_POLICY="DENY"/DEFAULT_FORWARD_POLICY="ACCEPT"/g' /etc/default/ufw sudo ufw reload &>/dev/null
sudo ufw reload sudo ufw --force enable &>/dev/null
sudo ufw --force enable
clear clear
echo "Installing Oracle Java JDK 8" echo "Installing Oracle Java JDK 8."
echo "" sudo apt-get remove openjdk-6-jre default-jre default-jre-headless -y &>/dev/null
sudo apt-get remove openjdk-6-jre default-jre default-jre-headless -y sudo add-apt-repository ppa:webupd8team/java -y &>/dev/null && sudo apt update &>/dev/null && sudo apt install ant oracle-java8-set-default openjfx -y &>/dev/null
echo ""
sudo add-apt-repository ppa:webupd8team/java -y && sudo apt update && sudo apt install ant oracle-java8-set-default openjfx -y
fi fi
# Ubuntu OS <=================================================== # Ubuntu OS <===================================================
@@ -87,43 +77,36 @@ if [ "$install" == "1" ]; then
echo "${RED}2${NC} - Yes" echo "${RED}2${NC} - Yes"
echo "" echo ""
echo "Which of the above do you wish to do? Type the choice number and press enter." echo "Which of the above do you wish to do? Type the choice number and press enter."
echo ""
echo ""
read brew read brew
# Mac 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)" &>/dev/null
brew install git brew install git &>/dev/null
fi fi
# Mac Brew <=================================================== # Mac Brew <===================================================
clear clear
echo "Verifying the basics are installed." echo "Verifying the basics are installed."
echo "" brew install unzip wget git curl zip screen &>/dev/null
brew install unzip wget git curl zip screen brew tap AdoptOpenJDK/openjdk &>/dev/null
brew tap AdoptOpenJDK/openjdk brew install adoptopenjdk-openjdk8 ant openjfx &>/dev/null
brew install adoptopenjdk-openjdk8 ant openjfx
clear clear
echo "Downloading the Docker for Mac installer." echo "Downloading the Docker for Mac installer."
echo "" wget https://download.docker.com/mac/stable/Docker.dmg &>/dev/null
wget https://download.docker.com/mac/stable/Docker.dmg hdiutil attach Docker.dmg &>/dev/null
hdiutil attach Docker.dmg
echo "" echo ""
echo "Please drag Docker as instructed in the popup." echo "Please drag Docker as instructed in the popup."
echo "" echo ""
echo "Press enter when finished." echo "Press enter when finished."
echo ""
read read
clear clear
open /Applications/Docker.app open /Applications/Docker.app
echo ""
echo "Docker is launching. Please follow the directions that it gives you." echo "Docker is launching. Please follow the directions that it gives you."
echo "" echo ""
echo "Press enter when finished." echo "Press enter when finished."
echo ""
read read
fi fi
# Mac OS <=================================================== # Mac OS <===================================================
@@ -133,8 +116,7 @@ if [ "$install" == "1" ]; then
clear clear
echo "Checking for updates to the Docker-Home repository." echo "Checking for updates to the Docker-Home repository."
echo "" sudo git pull &>/dev/null
sudo git pull
clear clear
echo "${RED}Open RSC Installer:${NC} echo "${RED}Open RSC Installer:${NC}
@@ -147,8 +129,6 @@ Choices:
" "
echo "" echo ""
echo "Which of the above do you wish to do? Type the choice number and press enter." echo "Which of the above do you wish to do? Type the choice number and press enter."
echo ""
echo ""
read choice read choice
# Selection ===================================================> # Selection ===================================================>
@@ -158,31 +138,25 @@ if [ "$choice" == "1" ]; then
echo "You have picked ${GREEN}set up for single player!${NC}" echo "You have picked ${GREEN}set up for single player!${NC}"
echo "" echo ""
echo "" echo ""
echo "Starting up the Docker containers. If error, do \"sudo make stop\" and rerun script." echo "Starting up the Docker containers."
echo "" sudo make start-single-player &>/dev/null
sudo make start-single-player
clear clear
echo "Fetching the Game from the Open RSC git repo." echo "Fetching the Game from the Open RSC git repo."
echo "" sudo make clone-game &>/dev/null
sudo make clone-game sudo chmod -R 777 Game &>/dev/null
sudo chmod -R 777 Game
clear clear
echo "Creating the client cache in your home folder." echo "Creating the client cache in your home folder."
echo "" mkdir ~/OpenRSC &>/dev/null
mkdir ~/OpenRSC unzip -o Game/client/cache.zip -d ~/OpenRSC &>/dev/null
unzip -o Game/client/cache.zip -d ~/OpenRSC
clear clear
echo "Importing the game databases." echo "Importing the game databases."
echo "" sudo make import-game &>/dev/null
sudo make import-game
clear clear
echo "Ready to launch \"./Linux_Single_Player.sh\" - Press enter when ready." echo "Ready to launch \"./Linux_Single_Player.sh\" - Press enter when ready."
echo ""
echo ""
read next read next
./Linux_Single_Player.sh ./Linux_Single_Player.sh
# 1. Set up for single player <=================================================== # 1. Set up for single player <===================================================
@@ -193,23 +167,20 @@ elif [ "$choice" == "2" ]; then
echo "You have picked ${GREEN}deployment for a publicly hosted server!${NC}" echo "You have picked ${GREEN}deployment for a publicly hosted server!${NC}"
echo "" echo ""
echo "" echo ""
echo "Starting up the Docker containers. If error, do \"sudo make stop\" and rerun script." echo "Starting up the Docker containers."
echo "" sudo chmod -R 777 &>/dev/null
sudo chmod -R 777 . sudo make start &>/dev/null
sudo make start
clear clear
echo "Fetching the Website and Game from the Open RSC git repo." echo "Fetching the Website and Game from the Open RSC git repo."
echo "" sudo make clone-game &>/dev/null
sudo make clone-game sudo make clone-website &>/dev/null
sudo make clone-website sudo chmod -R 777 &>/dev/null
sudo chmod -R 777 .
clear clear
echo "Creating the client cache in your home folder." echo "Creating the client cache in your home folder."
echo "" mkdir ~/OpenRSC &>/dev/null
mkdir ~/OpenRSC unzip -o Game/client/cache.zip -d ~/OpenRSC &>/dev/null
unzip -o Game/client/cache.zip -d ~/OpenRSC
clear clear
echo "Next is manual file editing for the website domain and SQL user/pass." echo "Next is manual file editing for the website domain and SQL user/pass."
@@ -231,19 +202,15 @@ elif [ "$choice" == "2" ]; then
clear clear
echo "Importing the databases." echo "Importing the databases."
echo "" sudo make import-game &>/dev/null
sudo make import-game sudo make import-ghost &>/dev/null
sudo make import-ghost
clear clear
echo "Restarting Docker containers" echo "Restarting Ghost container."
echo "" sudo docker stop ghost && sudo docker start ghost &>/dev/null
sudo make stop && sudo make start
clear clear
echo "Ready to launch \"./Linux_Fetch_Updates_Production.sh\" - Press enter when ready." echo "Ready to launch \"./Linux_Fetch_Updates_Production.sh\" - Press enter when ready."
echo ""
echo ""
read next read next
./Linux_Fetch_Updates_Production.sh ./Linux_Fetch_Updates_Production.sh
# 2. Deployment for a publicly hosted server <=================================================== # 2. Deployment for a publicly hosted server <===================================================
@@ -252,13 +219,9 @@ elif [ "$choice" == "2" ]; then
elif [ "$choice" == "3" ]; then elif [ "$choice" == "3" ]; then
echo "You have picked ${GREEN}backup all SQL databases!${NC}" echo "You have picked ${GREEN}backup all SQL databases!${NC}"
echo "" sudo make backup &>/dev/null
echo "" clear
sudo make backup
echo ""
echo ""
echo "Done! - Press enter to return back to the menu." echo "Done! - Press enter to return back to the menu."
echo ""
read read
./Linux_Installer.sh ./Linux_Installer.sh
# 3. Backup <=================================================== # 3. Backup <===================================================

View File

@@ -4,14 +4,13 @@
./Linux_Backup_Databases.sh ./Linux_Backup_Databases.sh
# Run the game server in a detached screen # Run the game server in a detached screen
echo "" clear
echo ""
echo "Launching the game server in a new screen." echo "Launching the game server in a new screen."
echo "" echo ""
echo "Type 'screen -r' to access the game server screen." echo "Type 'screen -r' to access the game server screen."
echo "Use CTRL + A + D to detach the live server screen so it runs in the background." echo "Use CTRL + A + D to detach the live server screen so it runs in the background."
echo "" echo ""
echo "" echo ""
touch gameserver.log && chmod 777 gameserver.log touch gameserver.log && chmod 777 gameserver.log &>/dev/null
cd Game/server cd Game/server
screen -dmS name ./ant_launcher.sh screen -dmS name ./ant_launcher.sh

View File

@@ -3,70 +3,54 @@
source .env source .env
# Check for any updates to the game server # Check for any updates to the game server
echo "" clear
echo "Pulling recent updates from the Open-RSC Game repository." echo "Pulling recent updates from the Open-RSC Game repository."
echo "" sudo git pull &>/dev/null
sudo git pull sudo make pull-game &>/dev/null
sudo make pull-game
echo "" clear
echo ""
echo "Starting Docker containers." echo "Starting Docker containers."
echo "" sudo make stop &>/dev/null
sudo make stop sudo make start-single-player &>/dev/null
sudo make start-single-player
echo ""
echo ""
# Compile the game server and client # Compile the game server and client
echo "Compiling the game client." clear
echo "" echo "Compiling the game client. Any errors will be in compile.log"
sudo ant -f "Game/client/build.xml" compile touch compile.log && chmod 777 compile.log &>/dev/null
echo "" sudo ant -f "Game/client/build.xml" compile | tee compile.log &>/dev/null
echo ""
echo "Compiling the game server." clear
echo "" echo "Compiling the game server. Any errors will be in compile.log"
sudo ant -f "Game/server/build.xml" compile sudo ant -f "Game/server/build.xml" compile | tee -a compile.log &>/dev/null
echo ""
echo ""
#Create game cache #Create game cache
clear
echo "Removing old cache if exists and then extracting a fresh client cache to your home folder." echo "Removing old cache if exists and then extracting a fresh client cache to your home folder."
echo "" sudo rm -rf ~/OpenRSC &>/dev/null
sudo rm -rf ~/OpenRSC mkdir ~/OpenRSC &>/dev/null
mkdir ~/OpenRSC
unzip -o Game/client/cache.zip -d ~/OpenRSC >/dev/null unzip -o Game/client/cache.zip -d ~/OpenRSC >/dev/null
echo ""
echo ""
#Import fresh version of config database #Import fresh version of config database
clear
echo "Importing a fresh openrsc_config.sql database." echo "Importing a fresh openrsc_config.sql database."
echo ""
sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" < Game/Databases/openrsc_config.sql 2>/dev/null sudo docker exec -i $(sudo docker-compose ps -q mysqldb) mysql -u"$MYSQL_ROOT_USER" -p"$MYSQL_ROOT_PASSWORD" < Game/Databases/openrsc_config.sql 2>/dev/null
echo ""
echo ""
#Generate updated cache files, copies them to cache folder overwriting existing #Generate updated cache files, copies them to cache folder overwriting existing
clear
echo "Generating cache .dat files from current config database and copying to client cache in your home folder." echo "Generating cache .dat files from current config database and copying to client cache in your home folder."
echo "" sudo ant -f Game/server/build.xml npcs items objects &>/dev/null
sudo ant -f Game/server/build.xml npcs items objects > /dev/null yes | cp -rf Game/server/npcs.dat ~/OpenRSC/npcs.dat &>/dev/null
yes | cp -rf Game/server/npcs.dat ~/OpenRSC/npcs.dat yes | cp -rf Game/server/objects.dat ~/OpenRSC/objects.dat &>/dev/null
yes | cp -rf Game/server/objects.dat ~/OpenRSC/objects.dat yes | cp -rf Game/server/items.dat ~/OpenRSC/items.dat &>/dev/null
yes | cp -rf Game/server/items.dat ~/OpenRSC/items.dat
echo ""
echo ""
# Run the game client in a new window # Run the game client in a new window
clear
echo "Launching the game client." echo "Launching the game client."
echo ""
#ant -f Game/client/build.xml runclient & #ant -f Game/client/build.xml runclient &
java -jar Game/client/Open_RSC_Client.jar & java -jar Game/client/Open_RSC_Client.jar &
echo ""
echo ""
# Run the game server in the current window # Run the game server in the current window
clear
echo "Launching the game server." echo "Launching the game server."
echo ""
#ant -f Game/server/build.xml runserver
cd Game/server cd Game/server
java -jar Open_RSC_Server.jar java -jar Open_RSC_Server.jar
echo ""