I have a game server company and on my control panel I currently have a page where a user can click a button and it installs a world on their game server. How this is done is via a script on the node which extracts the world onto their game server.
I have a few nodes and the panel is hosted on my web server. How would I do it so when they click the button on the website, it not only posts the value of the form to the script but also runs the script?
If you need to know, the script is as follows:
#!/bin/bash
id=$SERVERID
if [ "$WORLD" = "testworld" ]; then
cd "/home/minecraft/multicraft/servers/server$SERVERID"
unzip -nu "$JAR_DIR/maps/testworld.zip"
fi
exit 0
The variable $WORLD is what needs to be sent to the script as a POST from the form on the control panel.
The variable $SERVERID is defined at the top of the script and needs to also be sent from the form on the control panel. The control panel has already defined this variable, it just needs to be sent to the script as part of the form.
I am quite sure how to echo the $SERVERID variable on the line:
cd "/home/minecraft/multicraft/servers/server$SERVERID"
So help with that is also appreciated.
Any ideas?
Thanks