check_logs.sh 728 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # LinuxGSM check_logs.sh function
  3. # Author: Daniel Gibbs
  4. # Website: https://gameservermanagers.com
  5. # Description: Checks if log files exist.
  6. local commandname="CHECK"
  7. local function_selfname="$(basename $(readlink -f "${BASH_SOURCE[0]}"))"
  8. fn_check_logs(){
  9. fn_print_dots "Checking for log files"
  10. sleep 0.5
  11. fn_print_info_nl "Checking for log files: Creating log files"
  12. checklogs=1
  13. install_logs.sh
  14. }
  15. # Create directories for the script and console logs
  16. if [ ! -d "${scriptlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${gamename}" != "TeamSpeak 3" ]; then
  17. fn_check_logs
  18. fi
  19. # Create gamelogdir if variable exist but dir does not exist
  20. if [ -n "${gamelogdir}" ]&&[ ! -d "${gamelogdir}" ]; then
  21. fn_check_logs
  22. fi