check_logs.sh 760 B

123456789101112131415161718192021222324252627
  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. 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 "${lgsmlogdir}" ]||[ ! -d "${consolelogdir}" ]&&[ "${shortname}" != "ts3" ]; then
  17. fn_check_logs
  18. fi
  19. # Create gamelogdir
  20. # If variable exists gamelogdir exists and log/server does not
  21. if [ -n "${gamelogdir}" ]&&[ -d "${gamelogdir}" ]&&[ ! -d "${logdir}/server" ]; then
  22. fn_check_logs
  23. fi