From 4f120754d00f3fe7d0c1287f0ef7cf21dab02c3d Mon Sep 17 00:00:00 2001 From: Matheus sampaio Queiroga <50121801+Sirherobrine23@users.noreply.github.com> Date: Sun, 10 May 2020 20:45:37 -0300 Subject: [PATCH 1/2] teste --- menu | 13 ++++++++----- teste.sh | 0 teste2.sh | 47 +++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 55 insertions(+), 5 deletions(-) create mode 100644 teste.sh create mode 100644 teste2.sh diff --git a/menu b/menu index 2c1533f..00a56e8 100644 --- a/menu +++ b/menu @@ -5,15 +5,18 @@ cat banner.txt; #Variaveis SERVER_URL="https://minecraft.azureedge.net/bin-linux/bedrock-server-1.14.60.5.zip" SERVER_UPDATE="$(wget -qO- https://raw.githubusercontent.com/Sirherobrine23/Minecraft-Bedrock-auto-install/master/Update.txt)" -PATH_TO_INSTALL="/home/Minecraft" -PATH_TO_BACKUP="/home/Minecraft-Backup" +PATH_TO_INSTALL="/mnt/d/teste/Minecraft" +PATH_TO_BACKUP="/mnt/d/teste/Minecraft-Backup" IP_V4=$(hostname -i) IP_V6=$(hostname -I) IP_PUBLICO=$(wget -qO- ifconfig.me) file=mcpe FILE2=mcpe-start.txt -MAPA=$(cat /tmp/level.txt) -BACKUP="$(TZ=UTC+3 date +"%d-%m-%Y")-"$(cat /tmp/level.txt)"" +MAPA=$(cat $TMP/level.txt) +BACKUP="$(TZ=UTC+3 date +"%d-%m-%Y")" +TMP=/mnt/d/teste/tmp +rm -rf $TMP/level.txt +cat "$PATH_TO_INSTALL/mcpe/server.properties" | grep "level-name=" > "$TMP/level.txt" ; sed -i "s|level-name=||g" "$TMP/level.txt"; echo " " @@ -45,7 +48,7 @@ case $1 in echo -ne "####### completo ###### (100%)\r"; ;; "--update") - echo "Beta Ainda"; + bash teste.sh ;; "--screen") #install diff --git a/teste.sh b/teste.sh new file mode 100644 index 0000000..e69de29 diff --git a/teste2.sh b/teste2.sh new file mode 100644 index 0000000..6d85027 --- /dev/null +++ b/teste2.sh @@ -0,0 +1,47 @@ + +#Variaveis + +SERVER_URL="https://minecraft.azureedge.net/bin-linux/bedrock-server-1.14.60.5.zip" +SERVER_UPDATE="$(wget -qO- https://raw.githubusercontent.com/Sirherobrine23/Minecraft-Bedrock-auto-install/master/Update.txt)" +PATH_TO_INSTALL="/mnt/d/teste/Minecraft" +PATH_TO_BACKUP="/mnt/d/teste/Minecraft-Backup" +IP_V4=$(hostname -i) +IP_V6=$(hostname -I) +IP_PUBLICO=$(wget -qO- ifconfig.me) +file=mcpe +FILE2=mcpe-start.txt +MAPA=$(cat $TMP/level.txt) +BACKUP="$(TZ=UTC+3 date +"%d-%m-%Y")" +TMP=/mnt/d/teste/tmp +rm -rf $TMP/* +cat "$PATH_TO_INSTALL/mcpe/server.properties" | grep "level-name=" > "$TMP/level.txt" ; sed -i "s|level-name=||g" "$TMP/level.txt"; + + #Copiando + sudo mkdir $PATH_TO_BACKUP 2>> log.txt; + sudo mkdir $PATH_TO_BACKUP/$BACKUP 2>> log.txt; + sudo cp -r $PATH_TO_INSTALL/mcpe/worlds/* $PATH_TO_BACKUP/$BACKUP 2>> log.txt; + sudo cp $PATH_TO_INSTALL/mcpe/server.properties $PATH_TO_BACKUP/$BACKUP 2>> log.txt; + sudo cp $PATH_TO_INSTALL/mcpe/whitelist.json $PATH_TO_BACKUP/$BACKUP 2>> log.txt; + + #Movendo versão antiga para $TMP + sudo mv $PATH_TO_INSTALL $TMP 2>> log.txt; + + #Baixando +# sudo wget $SERVER_UPDATE -O $PATH_TO_INSTALL/mcpe.zip 2>> log.txt; +# sudo unzip $PATH_TO_INSTALL/mcpe.zip -d $PATH_TO_INSTALL/mcpe 2>> log.txt; +# sudo rm -r $PATH_TO_INSTALL/mcpe.zip 2>> log.txt; + + #Criando Diretorios + sudo mkdir $PATH_TO_INSTALL 2>> log.txt; + sudo mkdir $PATH_TO_INSTALL/mcpe 2>> log.txt; + + #Copiando mapa para nova versão + sudo rm -rf $PATH_TO_INSTALL/worlds 2>> log.txt; + sudo rm -rf $PATH_TO_INSTALL/server.properties 2>> log.txt; + sudo rm -rf $PATH_TO_INSTALL/whitelist.json 2>> log.txt; + sudo cp -r $PATH_TO_BACKUP/$BACKUP/$MAPA $PATH_TO_INSTALL/mcpe/worlds/ 2>> log.txt; + sudo cp $PATH_TO_BACKUP/$BACKUP/server.properties $PATH_TO_INSTALL/mcpe/ 2>> log.txt; + sudo cp $PATH_TO_BACKUP/$BACKUP/whitelist.json $PATH_TO_INSTALL/mcpe/ 2>> log.txt; + + sudo rm -rf $PATH_TO_INSTALL/mcpe/worlds/server.properties 2>> log.txt; + sudo rm -rf $PATH_TO_INSTALL/mcpe/worlds/whitelist.json 2>> log.txt; \ No newline at end of file -- 2.45.2 From 4394ba8836b54d0eaa779cfeaf6b2cec3c758c48 Mon Sep 17 00:00:00 2001 From: Matheus sampaio Queiroga <50121801+Sirherobrine23@users.noreply.github.com> Date: Sun, 10 May 2020 21:41:30 -0300 Subject: [PATCH 2/2] update on beta --- menu | 82 ++++++++++++++++++++++++++++++++++++++++--------------- teste.sh | 0 teste2.sh | 47 ------------------------------- 3 files changed, 60 insertions(+), 69 deletions(-) delete mode 100644 teste.sh delete mode 100644 teste2.sh diff --git a/menu b/menu index 00a56e8..4db8290 100644 --- a/menu +++ b/menu @@ -1,54 +1,92 @@ #!/bin/bash - #banner -cat banner.txt; - +clear #Variaveis SERVER_URL="https://minecraft.azureedge.net/bin-linux/bedrock-server-1.14.60.5.zip" SERVER_UPDATE="$(wget -qO- https://raw.githubusercontent.com/Sirherobrine23/Minecraft-Bedrock-auto-install/master/Update.txt)" -PATH_TO_INSTALL="/mnt/d/teste/Minecraft" -PATH_TO_BACKUP="/mnt/d/teste/Minecraft-Backup" +PATH_TO_INSTALL="/home/Minecraft" +PATH_TO_BACKUP="/home/Minecraft-Backup" IP_V4=$(hostname -i) IP_V6=$(hostname -I) IP_PUBLICO=$(wget -qO- ifconfig.me) file=mcpe FILE2=mcpe-start.txt -MAPA=$(cat $TMP/level.txt) BACKUP="$(TZ=UTC+3 date +"%d-%m-%Y")" -TMP=/mnt/d/teste/tmp -rm -rf $TMP/level.txt -cat "$PATH_TO_INSTALL/mcpe/server.properties" | grep "level-name=" > "$TMP/level.txt" ; sed -i "s|level-name=||g" "$TMP/level.txt"; - +TMP=/home/Minecraft/tmp &> ./log.txt; +sudo mkdir $TMP &> ./log.txt; +rm -rf $TMP/level.txt &> ./log.txt; +cat "$PATH_TO_INSTALL/mcpe/server.properties" | grep "level-name=" > "$TMP/level.txt" ; sed -i "s|level-name=||g" "$TMP/level.txt" &> ./log.txt; +MAPA=$(cat $TMP/level.txt) echo " " case $1 in - "-h") cat help.txt ; echo " " + "-h") cat banner.txt ; cat help.txt ; echo " " ;; - "--help") cat help.txt ; echo " " + "--help") cat banner.txt ; cat help.txt ; echo " " ;; "--install") + #banner + cat banner.txt; # Prerequisite echo " "; echo "Instalando os Pré-reuisitos para o debian, ubuntu"; echo -ne "# (01%)\r"; - sudo apt install -y wget unzip ; + sudo apt install -y wget unzip 2>> log.txt &> ./log.txt; echo -ne "## (02%)\r"; - sudo mkdir $PATH_TO_INSTALL ; + sudo mkdir $PATH_TO_INSTALL &> ./log.txt; #Download do arquivos servidor - sudo wget $SERVER_URL -O $PATH_TO_INSTALL/mcpe.zip ; + sudo wget $SERVER_URL -O $PATH_TO_INSTALL/mcpe.zip &> ./log.txt; echo -ne "######## (40%)\r"; - sudo unzip $PATH_TO_INSTALL/mcpe.zip -d $PATH_TO_INSTALL/mcpe ; - sudo rm -r $PATH_TO_INSTALL/mcpe.zip; + sudo unzip -o $PATH_TO_INSTALL/mcpe.zip -d $PATH_TO_INSTALL/mcpe &> ./log.txt; + sudo rm -rf $PATH_TO_INSTALL/mcpe.zip; echo -ne "############# (50%)\r"; #config - rm -rf $PATH_TO_INSTALL/mcpe/server.properties - rm -rf $PATH_TO_INSTALL/mcpe/whitelist.json - cp -r ./server.properties $PATH_TO_INSTALL/mcpe/ - cp -r ./whitelist.json $PATH_TO_INSTALL/mcpe/ + rm -rf $PATH_TO_INSTALL/mcpe/server.properties &> ./log.txt; + rm -rf $PATH_TO_INSTALL/mcpe/whitelist.json &> ./log.txt; + cp -r ./server.properties $PATH_TO_INSTALL/mcpe/ &> ./log.txt; + cp -r ./whitelist.json $PATH_TO_INSTALL/mcpe/ &> ./log.txt; echo -ne "####################### (100%)\r"; echo -ne "####### completo ###### (100%)\r"; + sudo cat "./log.txt" ;; "--update") - bash teste.sh + #banner + cat banner.txt; + #Copiando + echo -ne " (0%)\r"; + sudo mkdir $PATH_TO_BACKUP &> ./log.txt; + sudo mkdir $PATH_TO_BACKUP/$BACKUP &> ./log.txt; + echo -ne "# (1%)\r"; + sudo cp -r $PATH_TO_INSTALL/mcpe/worlds/* $PATH_TO_BACKUP/$BACKUP &> ./log.txt; + sudo cp $PATH_TO_INSTALL/mcpe/server.properties $PATH_TO_BACKUP/$BACKUP &> ./log.txt; + sudo cp $PATH_TO_INSTALL/mcpe/whitelist.json $PATH_TO_BACKUP/$BACKUP &> ./log.txt; + #Movendo versão antiga para $TMP + echo -ne "## (10%)\r"; + + sudo mv $PATH_TO_INSTALL $TMP &> ./log.txt; + #Baixando + sudo rm -rf $PATH_TO_INSTALL/mcpe.zip &> ./log.txt; + sudo wget $SERVER_UPDATE -O $PATH_TO_INSTALL/mcpe.zip &> ./log.txt; + sudo unzip -o $PATH_TO_INSTALL/mcpe.zip -d $PATH_TO_INSTALL/mcpe &> ./log.txt; + sudo rm -r $PATH_TO_INSTALL/mcpe.zip &> ./log.txt; + echo -ne "########### (50%)\r"; + #Criando Diretorios + sudo mkdir $PATH_TO_INSTALL &> ./log.txt; + sudo mkdir $PATH_TO_INSTALL/mcpe &> ./log.txt; + + #Copiando mapa para nova versão + sudo rm -rf $PATH_TO_INSTALL/worlds &> ./log.txt; + sudo rm -rf $PATH_TO_INSTALL/server.properties &> ./log.txt; + sudo rm -rf $PATH_TO_INSTALL/whitelist.json &> ./log.txt; + sudo cp -r $PATH_TO_BACKUP/$BACKUP/$MAPA $PATH_TO_INSTALL/mcpe/worlds/ &> ./log.txt; + sudo cp $PATH_TO_BACKUP/$BACKUP/server.properties $PATH_TO_INSTALL/mcpe/ &> ./log.txt; + sudo cp $PATH_TO_BACKUP/$BACKUP/whitelist.json $PATH_TO_INSTALL/mcpe/ &> ./log.txt; + + sudo rm -rf $PATH_TO_INSTALL/mcpe/worlds/server.properties &> ./log.txt; + sudo rm -rf $PATH_TO_INSTALL/mcpe/worlds/whitelist.json &> ./log.txt; + sudo rm -r $PATH_TO_BACKUP + echo -ne "####################### (100%)\r"; + echo -ne "###### Completo ####### (100%)\r"; + sudo cat "./log.txt" ;; "--screen") #install diff --git a/teste.sh b/teste.sh deleted file mode 100644 index e69de29..0000000 diff --git a/teste2.sh b/teste2.sh deleted file mode 100644 index 6d85027..0000000 --- a/teste2.sh +++ /dev/null @@ -1,47 +0,0 @@ - -#Variaveis - -SERVER_URL="https://minecraft.azureedge.net/bin-linux/bedrock-server-1.14.60.5.zip" -SERVER_UPDATE="$(wget -qO- https://raw.githubusercontent.com/Sirherobrine23/Minecraft-Bedrock-auto-install/master/Update.txt)" -PATH_TO_INSTALL="/mnt/d/teste/Minecraft" -PATH_TO_BACKUP="/mnt/d/teste/Minecraft-Backup" -IP_V4=$(hostname -i) -IP_V6=$(hostname -I) -IP_PUBLICO=$(wget -qO- ifconfig.me) -file=mcpe -FILE2=mcpe-start.txt -MAPA=$(cat $TMP/level.txt) -BACKUP="$(TZ=UTC+3 date +"%d-%m-%Y")" -TMP=/mnt/d/teste/tmp -rm -rf $TMP/* -cat "$PATH_TO_INSTALL/mcpe/server.properties" | grep "level-name=" > "$TMP/level.txt" ; sed -i "s|level-name=||g" "$TMP/level.txt"; - - #Copiando - sudo mkdir $PATH_TO_BACKUP 2>> log.txt; - sudo mkdir $PATH_TO_BACKUP/$BACKUP 2>> log.txt; - sudo cp -r $PATH_TO_INSTALL/mcpe/worlds/* $PATH_TO_BACKUP/$BACKUP 2>> log.txt; - sudo cp $PATH_TO_INSTALL/mcpe/server.properties $PATH_TO_BACKUP/$BACKUP 2>> log.txt; - sudo cp $PATH_TO_INSTALL/mcpe/whitelist.json $PATH_TO_BACKUP/$BACKUP 2>> log.txt; - - #Movendo versão antiga para $TMP - sudo mv $PATH_TO_INSTALL $TMP 2>> log.txt; - - #Baixando -# sudo wget $SERVER_UPDATE -O $PATH_TO_INSTALL/mcpe.zip 2>> log.txt; -# sudo unzip $PATH_TO_INSTALL/mcpe.zip -d $PATH_TO_INSTALL/mcpe 2>> log.txt; -# sudo rm -r $PATH_TO_INSTALL/mcpe.zip 2>> log.txt; - - #Criando Diretorios - sudo mkdir $PATH_TO_INSTALL 2>> log.txt; - sudo mkdir $PATH_TO_INSTALL/mcpe 2>> log.txt; - - #Copiando mapa para nova versão - sudo rm -rf $PATH_TO_INSTALL/worlds 2>> log.txt; - sudo rm -rf $PATH_TO_INSTALL/server.properties 2>> log.txt; - sudo rm -rf $PATH_TO_INSTALL/whitelist.json 2>> log.txt; - sudo cp -r $PATH_TO_BACKUP/$BACKUP/$MAPA $PATH_TO_INSTALL/mcpe/worlds/ 2>> log.txt; - sudo cp $PATH_TO_BACKUP/$BACKUP/server.properties $PATH_TO_INSTALL/mcpe/ 2>> log.txt; - sudo cp $PATH_TO_BACKUP/$BACKUP/whitelist.json $PATH_TO_INSTALL/mcpe/ 2>> log.txt; - - sudo rm -rf $PATH_TO_INSTALL/mcpe/worlds/server.properties 2>> log.txt; - sudo rm -rf $PATH_TO_INSTALL/mcpe/worlds/whitelist.json 2>> log.txt; \ No newline at end of file -- 2.45.2