start-smb-linux.sh 983 B

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