check_executable.sh 621 B

1234567891011121314151617181920
  1. #!/bin/bash
  2. # LinuxGSM check_executable.sh module
  3. # Author: Daniel Gibbs
  4. # Contributors: https://linuxgsm.com/contrib
  5. # Website: https://linuxgsm.com
  6. # Description: Checks if server executable exists.
  7. moduleselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. # Check if executable exists
  9. execname=$(basename "${executable}")
  10. if [ ! -f "${executabledir}/${execname}" ]; then
  11. fn_print_fail_nl "executable was not found"
  12. echo -e "* ${executabledir}/${execname}"
  13. if [ -d "${lgsmlogdir}" ]; then
  14. fn_script_log_fail "Executable was not found: ${executabledir}/${execname}"
  15. fi
  16. unset exitbypass
  17. core_exit.sh
  18. fi