status.sh 795 B

12345678910111213141516171819202122232425262728293031323334
  1. #!/bin/bash
  2. CURRDIR=$(realpath $(dirname $0))
  3. echo '== Basic info:'
  4. if [ -f "${CURRDIR}/run/running_containers" ]; then
  5. echo 'Status: Running'
  6. echo "Drone URL: $(cat ${CURRDIR}/run/tunneling_url)"
  7. else
  8. echo 'Status: Stopped'
  9. fi
  10. if [ -f "${CURRDIR}/config.sh" ]; then
  11. echo 'Config present: Yes'
  12. source "${CURRDIR}/config.sh"
  13. if [ -z "$REPO_PROVIDER" ]; then
  14. echo "(Error: Outdated config. Please check 'Troubleshooting' section of docs/config.md to update it.)"
  15. else
  16. echo "Repo provider: $REPO_PROVIDER"
  17. echo "Repo server: $REPO_SERVER"
  18. echo "Repo username: $REPO_USERNAME"
  19. fi
  20. else
  21. echo 'Config present: No'
  22. fi
  23. echo '== Running containers:'
  24. if [ -f "${CURRDIR}/run/running_containers" ]; then
  25. cat "${CURRDIR}/run/running_containers"
  26. else
  27. echo '(No containers running)'
  28. fi