1
0

stop-webdav-apache.sh 856 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/bash
  2. #
  3. # SPDX-FileCopyrightText: 2015-2016 ownCloud, Inc.
  4. # SPDX-License-Identifier: AGPL-3.0-only
  5. #
  6. if ! command -v docker >/dev/null 2>&1; then
  7. echo "No docker executable found - skipped docker stop"
  8. exit 0;
  9. fi
  10. echo "Docker executable found - stop and remove docker containers"
  11. # retrieve current folder to remove the config from the parent folder
  12. thisFolder=`echo $0 | sed 's#env/stop-webdav-apache\.sh##'`
  13. if [ -z "$thisFolder" ]; then
  14. thisFolder="."
  15. fi;
  16. # stopping and removing docker containers
  17. for container in `cat $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav`; do
  18. echo "Stopping and removing docker container $container"
  19. # kills running container and removes it
  20. docker rm -f $container
  21. done;
  22. # cleanup
  23. rm $thisFolder/config.webdav.php
  24. rm $thisFolder/dockerContainerWebdav.$EXECUTOR_NUMBER.webdav