diff --git a/FreeOP Servers/.my.cnf.example b/FreeOP Servers/.my.cnf.example new file mode 100644 index 0000000..cae8735 --- /dev/null +++ b/FreeOP Servers/.my.cnf.example @@ -0,0 +1,7 @@ +[mysqldump] +user=database-username +password="MySuperSecurePassword!" + +[mysql] +user=database-username +password="MySuperSecurePassword!" \ No newline at end of file diff --git a/FreeOP Servers/reset.sh b/FreeOP Servers/reset.sh index 122befd..a9f3bf3 100644 --- a/FreeOP Servers/reset.sh +++ b/FreeOP Servers/reset.sh @@ -48,8 +48,11 @@ else then 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 - else - echo "Big yay, no database shite" + echo "CoreProtect Database downloaded to /home/tfserver/archives/$CO_DATABASE-$TIMESTAMP.sql" + 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 # 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." fi fi -fi \ No newline at end of file +fi diff --git a/FreeOP Servers/start.sh b/FreeOP Servers/start.sh index 7bab46e..cde7693 100644 --- a/FreeOP Servers/start.sh +++ b/FreeOP Servers/start.sh @@ -15,6 +15,5 @@ else else screen -dmS $SCREEN_NAME java -Xms$JVM_HEAP -Xmx$JVM_HEAP $JVM_LAUNCH_OPTS -jar $PAPER_JAR_NAME echo "Server Started" - exit 0 fi fi diff --git a/FreeOP Servers/stop.sh b/FreeOP Servers/stop.sh index 9e80772..e3fd2f5 100644 --- a/FreeOP Servers/stop.sh +++ b/FreeOP Servers/stop.sh @@ -25,10 +25,8 @@ else exit 1 else echo "Server has been shut down succesfully." - exit 0 fi else echo "$SARCASTIC_MESSAGE" - exit 0 fi fi \ No newline at end of file