fix_squad.sh 945 B

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