Fun Stuff
Fun Stuff
Self-extracting, self-contained script
It's possible to store the contents of your server pack in side a bash script which upon execution, will extract itself, and therefor the contents of the server pack, to a sub-directory in your users home-directory and then immediately start the server.
So instead of shipping/sending a ZIP-file to CurseForge, Modrinth, your friends, you can send them a script and tell them to simply run it.
build-script
decompress-script
How To
Create both the build
and the decompress
scripts inside the server-packs
directory of ServerPackCreator.
Run the build-script with the server pack you want to create a self-extracting script of like so: ./build <ServerPackFolder>
, where <ServerPackFolder>
is to be replaced with the name of the server pack folder, for example All_the_Mods_9_-_ATM9
, so the call becomes ./build All_the_Mods_9_-_ATM9
.
Depending on the size of your server pack, this may take a while.
When the script finishes you should see All_the_Mods_9_-_ATM9.bsx created
in your console and a file called All_the_Mods_9_-_ATM9.bsx
in your server-packs folder. The script file should be roughly the same size as the folder of your server pack.
Copy the script to some other directory and run it: ./All_the_Mods_9_-_ATM9.bsx
It will extract the contents to /tmp/selfextract.XXXXXX
first, then create a new folder inside your users home-directory and copy the files there, so you then have /home/<YOUR_USER>/mc-servers/All_the_Mods_9_-_ATM9
.
When all files have been copied, the extract-script switches to the aforementioned directory and runs the start.sh
-script, immediately starting the server.
Done!
Nice, quick and easy server pack provision.