ME1312 / SubServers-2

SubServers – The Minecraft Server Management Platform
Apache License 2.0
91 stars 23 forks source link

SubCreator Settingvariables in Shell #31

Closed xXSchrandXx closed 5 years ago

xXSchrandXx commented 5 years ago

What Should Be Added

The setting-variables ($name$, $template$, $type$, $version$, and $port$) added in the shell I can run with the template. E.g in bash:

echo 'Starting with the creation of $name$.'
echo 'Name: $name§'
echo 'Template: $template$'
echo 'Type: $type$'
echo 'Version: $version$'
echo 'Port: $port$'

echo 'Copy default-files'
cp $defaults/. $serverfolder'/$name$'

echo 'Edit Luckpermsconfig'
sed -Ez 's/(server: )global/\1$name$/g' $luckpermsconfig

Why It Should be Added

I'm using Softlinks for the most of my plugins (to save some space and to upload a pluginupdate only one time into my plugin folder). I know you have a Sync addon for SubServer. But I have used the Softlinks before I startet with subservers... And for automaticly edditing configs (e.g. with luckperms) it can save a lot of time.

What's The Alternative

Recreate my network and use your sync addon...

ME1312 commented 5 years ago

This modification has been noted for a future dev build. Even though I don't quite understand how $template$ and $type$ could be useful, since they're value will always be the same as defined by template.yml, but I'll probably include them anyway.

Keep in mind that these variables may have to take on the formatting of the interpreter so, in this case, bash variables would look like $name instead of the format used in subservers yaml.

Also as a side note, this is not the intended use case of SubServers.Sync so that's probably not going to help you here.

ME1312 commented 5 years ago

This feature has been added to SubCreator as a replacement to the legacy shell argument system. To see what extra variables are now available, check SubCreator's wiki page.

xXSchrandXx commented 5 years ago

don't quite understand how $template$ and $type$ could be useful

At the moment I don't know that either, but someone could use it for something (E.g. server-path /home/minecraft/spigot/$version/$template/$name). But the more you can get by default the easier is the working with that.