This commit is contained in:
Wild1145 2021-06-27 21:26:27 +01:00
parent cc03139c28
commit a9f5d3dca0
4 changed files with 13 additions and 6 deletions

View file

@ -0,0 +1,7 @@
[mysqldump]
user=database-username
password="MySuperSecurePassword!"
[mysql]
user=database-username
password="MySuperSecurePassword!"

View file

@ -48,8 +48,11 @@ else
then then
mysqldump -h $DB_HOSTNAME $CO_DATABASE --no-tablespaces > $CO_DATABASE-$TIMESTAMP.sql mysqldump -h $DB_HOSTNAME $CO_DATABASE --no-tablespaces > $CO_DATABASE-$TIMESTAMP.sql
mv /home/tfserver/$CO_DATABASE-$TIMESTAMP.sql /home/tfserver/archives/$CO_DATABASE-$TIMESTAMP.sql mv /home/tfserver/$CO_DATABASE-$TIMESTAMP.sql /home/tfserver/archives/$CO_DATABASE-$TIMESTAMP.sql
else echo "CoreProtect Database downloaded to /home/tfserver/archives/$CO_DATABASE-$TIMESTAMP.sql"
echo "Big yay, no database shite" echo "SET FOREIGN_KEY_CHECKS = 0;" > ./temp.sql
mysqldump --add-drop-table --no-data --no-tablespaces -h $DB_HOSTNAME $CO_DATABASE | grep 'DROP TABLE' >> ./temp.sql
echo "SET FOREIGN_KEY_CHECKS = 1;" >> ./temp.sql
mysql $CO_DATABASE -h $DB_HOSTNAME < ./temp.sql
fi fi
# Need to add something around handling the MySQL shit here # Need to add something around handling the MySQL shit here
@ -62,4 +65,4 @@ else
echo "ERROR - The template: $1 you have attempted to restore, does not exist." echo "ERROR - The template: $1 you have attempted to restore, does not exist."
fi fi
fi fi
fi fi

View file

@ -15,6 +15,5 @@ else
else else
screen -dmS $SCREEN_NAME java -Xms$JVM_HEAP -Xmx$JVM_HEAP $JVM_LAUNCH_OPTS -jar $PAPER_JAR_NAME screen -dmS $SCREEN_NAME java -Xms$JVM_HEAP -Xmx$JVM_HEAP $JVM_LAUNCH_OPTS -jar $PAPER_JAR_NAME
echo "Server Started" echo "Server Started"
exit 0
fi fi
fi fi

View file

@ -25,10 +25,8 @@ else
exit 1 exit 1
else else
echo "Server has been shut down succesfully." echo "Server has been shut down succesfully."
exit 0
fi fi
else else
echo "$SARCASTIC_MESSAGE" echo "$SARCASTIC_MESSAGE"
exit 0
fi fi
fi fi