upgrade 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. #!/bin/bash
  2. # causes the shell to exit if any subcommand or pipeline returns a non-zero status
  3. set -e
  4. # See comments in install script
  5. app=$YNH_APP_INSTANCE_NAME
  6. # Retrieve arguments
  7. domain=$(sudo yunohost app setting $app domain)
  8. path=$(sudo yunohost app setting $app path)
  9. admin=$(sudo yunohost app setting $app admin)
  10. is_public=$(sudo yunohost app setting $app is_public)
  11. # Remove trailing "/" for next commands
  12. path=${path%/}
  13. # Copy source files
  14. final_path=/var/www/$app
  15. sudo mkdir -p $final_path
  16. sudo cp -a ../sources/. $final_path
  17. # Set permissions to app files
  18. # you may need to make some file and/or directory writeable by www-data (nginx user)
  19. sudo chown -R root:root $final_path
  20. # Modify Nginx configuration file and copy it to Nginx conf directory
  21. sed -i "s@YNH_WWW_PATH@$path@g" ../conf/nginx.conf
  22. sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/nginx.conf
  23. # If a dedicated php-fpm process is used :
  24. #
  25. #sudo sed -i "s@YNH_WWW_APP@$app@g" ../conf/nginx.conf
  26. sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
  27. # If a dedicated php-fpm process is used :
  28. # Adjustment and copy dedicated php-fpm conf file
  29. #
  30. #sed -i "s@YNH_WWW_APP@$app@g" ../conf/php-fpm.conf
  31. #sed -i "s@YNH_WWW_ALIAS@$final_path/@g" ../conf/php-fpm.conf
  32. #finalphpconf=/etc/php5/fpm/pool.d/$app.conf
  33. #sudo cp ../conf/php-fpm.conf $finalphpconf
  34. #sudo chown root: $finalphpconf
  35. #sudo chmod 644 $finalphpconf
  36. # If app is public, add url to SSOWat conf as skipped_uris
  37. if [ "$is_public" = "Yes" ];
  38. then
  39. # See install script
  40. sudo yunohost app setting $app unprotected_uris -v "/"
  41. # Remove old settings
  42. sudo yunohost app setting $app skipped_uris -d
  43. fi
  44. # If a dedicated php-fpm process is used :
  45. #
  46. #sudo service php5-fpm restart
  47. # Restart services
  48. sudo service nginx reload
  49. sudo yunohost app ssowatconf