check_logs.sh 687 B

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