Bez popisu

wait-for-iriswebapp.sh 1.0KB

1234567891011121314151617181920212223242526272829303132333435
  1. #!/bin/sh
  2. # wait-for-iriswebapp.sh
  3. # IRIS Source Code
  4. # Copyright (C) 2021 - Airbus CyberSecurity (SAS)
  5. # ir@cyberactionlab.net
  6. #
  7. # This program is free software; you can redistribute it and/or
  8. # modify it under the terms of the GNU Lesser General Public
  9. # License as published by the Free Software Foundation; either
  10. # version 3 of the License, or (at your option) any later version.
  11. #
  12. # This program is distributed in the hope that it will be useful,
  13. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  14. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  15. # Lesser General Public License for more details.
  16. #
  17. # You should have received a copy of the GNU Lesser General Public License
  18. # along with this program; if not, write to the Free Software Foundation,
  19. # Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
  20. set -e
  21. host="$1"
  22. shift
  23. sleep 1
  24. until curl "$host" >/dev/null 2>&1; do
  25. >&2 echo "IRISwebapp is unavailable - sleeping"
  26. sleep 1
  27. done
  28. >&2 echo "IRISwebapp is up - executing command"
  29. exec "$@"