stop-webdav-ownCloud.sh 1005 B

12345678910111213141516171819202122232425262728293031323334353637
  1. #!/bin/bash
  2. #
  3. # ownCloud
  4. #
  5. # This script stops the docker container the files_external tests were run
  6. # against. It will also revert the config changes done in start step.
  7. #
  8. # @author Morris Jobke
  9. # @copyright 2014 Morris Jobke <hey@morrisjobke.de>
  10. #
  11. if ! command -v docker >/dev/null 2>&1; then
  12. echo "No docker executable found - skipped docker stop"
  13. exit 0;
  14. fi
  15. echo "Docker executable found - stop and remove docker containers"
  16. # retrieve current folder to remove the config from the parent folder
  17. thisFolder=`echo $0 | sed 's#env/stop-webdav-ownCloud\.sh##'`
  18. if [ -z "$thisFolder" ]; then
  19. thisFolder="."
  20. fi;
  21. # stopping and removing docker containers
  22. for container in `cat $thisFolder/dockerContainerOwnCloud.$EXECUTOR_NUMBER.webdav`; do
  23. echo "Stopping and removing docker container $container"
  24. # kills running container and removes it
  25. docker rm -f $container
  26. done;
  27. # cleanup
  28. rm $thisFolder/config.webdav.php
  29. rm $thisFolder/dockerContainerOwnCloud.$EXECUTOR_NUMBER.webdav