Choose random map on server startup GMOD

Choose random map on server startup GMOD - Creative group of colleagues during work process

I run a dedicated TTT server for friends, and I have the server set to restart every day to get addon updates. Is there a way to make it start on random map?



Best Answer

If you're using a linux host and have basename available you could adapt this launch.sh I wrote to do this for my server.

#!/bin/bash
RANDOM_MAP=$(find gmod/garrysmod/maps -type f -name "*.bsp" | shuf -n 1 | xargs basename | cut -d. -f1)
./gmod/srcds_run +map $RANDOM_MAP

You'll just need to replace the path with your own maps directory path.




Pictures about "Choose random map on server startup GMOD"

Choose random map on server startup GMOD - From above of anonymous person selecting paper maps with captions in stack while spending time in library with blurred background
Choose random map on server startup GMOD - Free stock photo of algebra, business, chalk
Choose random map on server startup GMOD - Free stock photo of active, adult, adventure





The Ultimate GMOD Tier List




Sources: Stack Exchange - This article follows the attribution requirements of Stack Exchange and is licensed under CC BY-SA 3.0.

Images: Helena Lopes, Rafael Gonzales, Yan Krukov, Tima Miroshnichenko