1
0

setup.sh 980 B

123456789101112131415161718192021222324252627282930313233
  1. #!/bin/bash
  2. DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )/../" >/dev/null 2>&1 && pwd )"
  3. cd $DIR/
  4. # Set git safe.directory
  5. git config --global --add safe.directory /var/www/html
  6. git config --global --add safe.directory /var/www/html/3rdparty
  7. git submodule update --init
  8. # Codespace config
  9. cp .devcontainer/codespace.config.php config/codespace.config.php
  10. # VSCode debugger profile
  11. mkdir -p .vscode && cp .devcontainer/launch.json .vscode/launch.json
  12. # Onetime installation setup
  13. if [[ ! $(sudo -u ${APACHE_RUN_USER} php occ status) =~ installed:[[:space:]]*true ]]; then
  14. echo "Running NC installation"
  15. sudo -u ${APACHE_RUN_USER} php occ maintenance:install \
  16. --verbose \
  17. --database=pgsql \
  18. --database-name=postgres \
  19. --database-host=127.0.0.1 \
  20. --database-port=5432 \
  21. --database-user=postgres \
  22. --database-pass=postgres \
  23. --admin-user admin \
  24. --admin-pass admin
  25. fi
  26. sudo service apache2 restart