check_status.sh 412 B

1234567891011121314
  1. #!/bin/bash
  2. # LinuxGSM check_status.sh function
  3. # Author: Daniel Gibbs
  4. # Contributor: UltimateByte
  5. # Website: https://linuxgsm.com
  6. # Description: Checks the process status of the server. Either online or offline.
  7. functionselfname="$(basename "$(readlink -f "${BASH_SOURCE[0]}")")"
  8. if [ "$(tmux list-sessions -F "#{session_name}" 2>/dev/null)" == "${sessionname}${port}" ]; then
  9. status=1;
  10. else
  11. status=0;
  12. fi