start-smb-linux.sh 953 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. #
  3. # ownCloud
  4. #
  5. # This script start a docker container to test the files_external tests
  6. # against. It will also change the files_external config to use the docker
  7. # container as testing environment. This is reverted in the stop step.W
  8. #
  9. # Set environment variable DEBUG to print config file
  10. #
  11. # @author Morris Jobke
  12. # @copyright 2015 Morris Jobke <hey@morrisjobke.de>
  13. #
  14. # retrieve current folder to place the config in the parent folder
  15. thisFolder=`echo $0 | sed 's#env/start-smb-linux\.sh##'`
  16. if [ -z "$thisFolder" ]; then
  17. thisFolder="."
  18. fi;
  19. cat > $thisFolder/config.smb.php <<DELIM
  20. <?php
  21. return array(
  22. 'run'=>true,
  23. 'host'=>'127.0.0.1',
  24. 'user'=>'test',
  25. 'password'=>'test',
  26. 'root'=>'',
  27. 'share'=>'public',
  28. );
  29. DELIM
  30. echo -n "Waiting for samba initialization"
  31. if ! "$thisFolder"/env/wait-for-connection 127.0.0.1 445 60; then
  32. echo "[ERROR] Waited 60 seconds, no response" >&2
  33. exit 1
  34. fi
  35. sleep 1