From 6da779d59fa6b7351cffdf888898fce8b40fa65f Mon Sep 17 00:00:00 2001 From: ojhern24 Date: Fri, 5 May 2023 18:52:09 -0400 Subject: Refresh of old repository --- scripts/README.md | 5 +++++ scripts/runMinecraft.sh | 14 ++++++++++++++ scripts/test.sh | 1 + 3 files changed, 20 insertions(+) create mode 100644 scripts/README.md create mode 100644 scripts/runMinecraft.sh create mode 100644 scripts/test.sh (limited to 'scripts') diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 0000000..0651ef5 --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,5 @@ +## Access terminals after they are executed +In your terminal, use the command: `screen -r [name here]` +Example: `screen -r minecraft` + +**Remember to give these scripts execution permissions otherwise they will not work!** diff --git a/scripts/runMinecraft.sh b/scripts/runMinecraft.sh new file mode 100644 index 0000000..9d09583 --- /dev/null +++ b/scripts/runMinecraft.sh @@ -0,0 +1,14 @@ +#!/bin/sh +screen -d -m -S minecraft bash -c 'touch .running; cd; cd directory/to/your/minecraft/server; ./start.sh; cd; cd directory/to/dgsm/bot; rm .running; exit; exec bash' + +# In Layman's terms: + +# [Before server starts] +# Open a virtual terminal with the name 'minecraft', create a hidden file called '.running', go to home directory, go to minecraft server directory, +# execute server initialization script (MUST HAVE EXECUTE PERMISSIONS) + +# [After server shuts down] +# Go to root directory, go to this Discord bot's directory, delete '.running' file so that the $run command can be used once again, exit the virtual terminal so that +# this current session is terminated and there are not multiple terminals named 'minecraft' + +# i hope this makes sense diff --git a/scripts/test.sh b/scripts/test.sh new file mode 100644 index 0000000..739dc11 --- /dev/null +++ b/scripts/test.sh @@ -0,0 +1 @@ +echo "test" \ No newline at end of file -- cgit v1.2.3-54-g00ecf