fix_squad.sh 836 B

1234567891011121314151617181920212223
  1. #!/bin/bash
  2. # LinuxGSM fix_squad.sh function
  3. # Author: Christian Birk
  4. # Website: https://linuxgsm.com
  5. # Description: Resolves various issues with Squad.
  6. # As the server base dir changed for the game, we need to migrate the default config from the old to the new location
  7. oldservercfg="${serverfiles}/Squad/ServerConfig/${servercfg}"
  8. if [ -f "${oldservercfg}" ] && [ -f "${servercfgfullpath}" ]; then
  9. # diff old and new config - if it is different move the old config over the new one
  10. if [ "$(diff -c "${oldservercfg}" "${servercfgfullpath}" | wc -l)" -gt 0 ]; then
  11. fixname="Migrate server config to new Game folder"
  12. fn_fix_msg_start
  13. mv -v "${oldservercfg}" "${servercfgfullpath}"
  14. fn_fix_msg_end
  15. else
  16. fixname="remove the same config from old configdir"
  17. fn_fix_msg_start
  18. rm -f "${oldservercfg}"
  19. fn_fix_msg_end
  20. fi
  21. fi