Random Map on Startup | Linux Shell Script

BeamMP Random Map - Shell

this is currently linux only; a Windows version is in the works and will be added to the github repository

This is a simple shell script that should be used as your startup command (./start.sh). This script uses tmux as the window manager, so in order to see your server console once it is started you should use tmux attach while logged into the user that the server is running on.

The script should be placed in the root directory, the file locations at the top of the script should be updated to match that of your server’s

This chooses a random map on startup, to add maps please see below.

Here is the default map list

array[0]="/levels/gridmap_v2/info.json"
array[1]="/levels/utah/info.json"

Here is the list with one added

array[0]="/levels/gridmap_v2/info.json"
array[1]="/levels/utah/info.json"
array[2]="/levels/sandy_mountain/info.json|

The script is located on my github here: BeamMP Random Map - Github

2 Likes

Updated README from GH repository. I couldn’t edit this post again lol.


BeamMP Random Map - Shell

The powershell script in this repo can be run with PS7, if you don’t know how to do that, than you will need to wait for a newer release.

this is currently linux only; a Windows version is in the works and will be added to the github repository

This is a simple shell script that should be used as your startup command (./start.sh). This script uses tmux as the window manager, so in order to see your server console once it is started you should use tmux attach while logged into the user that the server is running on.

You should place both start.sh and restart.sh in the root directory of your server, the variables in these scripts should only be changed if you have a reason to do so.

The scripst should be placed in the root directory, the file locations at the top of the script should be updated to match that of your server’s

This chooses a random map on startup, to add maps please see below.

Here is the default map list

array[0]="/levels/gridmap_v2/info.json"
array[1]="/levels/utah/info.json"

Here is the list with one added

array[0]="/levels/gridmap_v2/info.json"
array[1]="/levels/utah/info.json"
array[2]="/levels/sandy_mountain/info.json|

Once you are done customizing the script, run the command chmod +x start.sh && chmod +x restart.sh; this will make the scripts executable, then it’s as simple as running ./start.sh or ./restart.sh

The script is located on my github here: BeamMP Random Map - Github

can we do that with a automatic restart?

Absolutely. I’m not going to put effort into it unless this thread gets bumped. I made this script for a few buddies a while ago and never followed up on it. However if you’re still interested let me know and I’ll throw something together.