mods-apply-world.mt-regenerate-from-config-file 1.3 KB

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. source config-file
  3. systemctl stop minetestsrv
  4. rm -rf /home/minetest/.minetest/mods
  5. cp -r mods /home/minetest/.minetest/mods
  6. echo "gameid = minetest" > /home/minetest/.minetest/worlds/world/world.mt
  7. echo "backend = postgresql" >> /home/minetest/.minetest/worlds/world/world.mt
  8. echo "creative_mode = $mt_creative_mode" >> /home/minetest/.minetest/worlds/world/world.mt
  9. echo "enable_damage = true" >> /home/minetest/.minetest/worlds/world/world.mt
  10. echo "player_backend = postgresql" >> /home/minetest/.minetest/worlds/world/world.mt
  11. echo "auth_backend = postgresql" >> /home/minetest/.minetest/worlds/world/world.mt
  12. echo "pgsql_connection = host=127.0.0.1 user=minetest password=$psql_minetest_user_password dbname=minetest" >> /home/minetest/.minetest/worlds/world/world.mt
  13. echo "pgsql_player_connection = host=127.0.0.1 user=minetest password=$psql_minetest_user_password dbname=minetest_players" >> /home/minetest/.minetest/worlds/world/world.mt
  14. echo "pgsql_auth_connection = host=127.0.0.1 user=minetest password=$psql_minetest_user_password dbname=minetest_auth" >> /home/minetest/.minetest/worlds/world/world.mt
  15. cat mods-list >> /home/minetest/.minetest/worlds/world/world.mt
  16. chown minetest:minetest /home/minetest/ -cR
  17. echo "Start minetestsrv service"
  18. systemctl start minetestsrv