Use RCON to check if there is players on an instance, and refuse to restart unless forced. The `status` cvar/command lists number of players online among other things.