fix-nginx.sh 556 B

123456789101112131415
  1. {% macro fix_nginx() -%}
  2. #!/bin/bash
  3. # Old installations had the "default" without extension,
  4. # and after a version the extension was added. Lets cover both cases.
  5. function check_file() {
  6. if [ ! -f $1 ]; then return; fi
  7. if grep -q "root /app/www/public" $1; then
  8. echo "Fixing nginx [$1] file"
  9. sed -i 's/root \/app\/www\/public/root \/app\/diskover-web\/public/g' $1 || { echo "Failed to fix nginx [$1] file"; exit 1; }
  10. fi
  11. }
  12. check_file "/config/nginx/site-confs/default.conf"
  13. check_file "/config/nginx/site-confs/default"
  14. {%- endmacro %}