check_logs.sh 736 B

1234567891011121314151617181920212223242526
  1. #!/bin/bash
  2. # LinuxGSM check_logs.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: http://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Checks if log files exist.
  7. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. fn_check_logs() {
  9. fn_print_dots "Checking for log files"
  10. fn_print_info_nl "Checking for log files: Creating log files"
  11. checklogs=1
  12. install_logs.sh
  13. }
  14. # Create directories for the script and console logs.
  15. if [ ! -d "${lgsmlogdir}" ] || [ ! -d "${consolelogdir}" ]; then
  16. fn_check_logs
  17. fi
  18. # Create gamelogdir.
  19. # If variable exists gamelogdir exists and log/server does not.
  20. if [ "${gamelogdir}" ] && [ -d "${gamelogdir}" ] && [ ! -d "${logdir}/server" ]; then
  21. fn_check_logs
  22. fi