mirror of
https://github.com/YunoHost-Apps/question2answer_ynh.git
synced 2024-09-03 20:16:07 +02:00
Merge pull request #14 from YunoHost/path_url
Avoid errors between $path and $PATH
This commit is contained in:
commit
5731d15d64
3 changed files with 10 additions and 10 deletions
|
@ -17,7 +17,7 @@ app=$YNH_APP_INSTANCE_NAME
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
domain=$YNH_APP_ARG_DOMAIN
|
domain=$YNH_APP_ARG_DOMAIN
|
||||||
path=$YNH_APP_ARG_PATH
|
path_url=$YNH_APP_ARG_PATH
|
||||||
admin=$YNH_APP_ARG_ADMIN
|
admin=$YNH_APP_ARG_ADMIN
|
||||||
is_public=$YNH_APP_ARG_IS_PUBLIC
|
is_public=$YNH_APP_ARG_IS_PUBLIC
|
||||||
language=$YNH_APP_ARG_LANGUAGE
|
language=$YNH_APP_ARG_LANGUAGE
|
||||||
|
@ -31,8 +31,8 @@ ynh_app_setting_set "$app" is_public "$is_public"
|
||||||
ynh_app_setting_set "$app" language "$language"
|
ynh_app_setting_set "$app" language "$language"
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
sudo yunohost app checkurl "${domain}${path_url}" -a "$app" \
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
src_path=/var/www/$app
|
src_path=/var/www/$app
|
||||||
|
@ -61,7 +61,7 @@ sudo chown -R root: $src_path
|
||||||
|
|
||||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||||
nginx_conf=../conf/nginx.conf
|
nginx_conf=../conf/nginx.conf
|
||||||
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
|
sed -i "s@YNH_WWW_PATH@$path_url@g" $nginx_conf
|
||||||
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
|
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
|
||||||
# If a dedicated php-fpm process is used:
|
# If a dedicated php-fpm process is used:
|
||||||
# Don't forget to modify ../conf/nginx.conf accordingly or your app will not work!
|
# Don't forget to modify ../conf/nginx.conf accordingly or your app will not work!
|
||||||
|
|
|
@ -14,11 +14,11 @@ source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Retrieve old app settings
|
# Retrieve old app settings
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
path_url=$(ynh_app_setting_get "$app" path_url)
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
sudo yunohost app checkurl "${domain}${path}" -a "$app" \
|
sudo yunohost app checkurl "${domain}${path_url}" -a "$app" \
|
||||||
|| ynh_die "Path not available: ${domain}${path}"
|
|| ynh_die "Path not available: ${domain}${path_url}"
|
||||||
|
|
||||||
# Restore sources & data
|
# Restore sources & data
|
||||||
src_path="/var/www/${app}"
|
src_path="/var/www/${app}"
|
||||||
|
|
|
@ -11,13 +11,13 @@ source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
# Retrieve app settings
|
# Retrieve app settings
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
path=$(ynh_app_setting_get "$app" path)
|
path_url=$(ynh_app_setting_get "$app" path_url)
|
||||||
admin=$(ynh_app_setting_get "$app" admin)
|
admin=$(ynh_app_setting_get "$app" admin)
|
||||||
is_public=$(ynh_app_setting_get "$app" is_public)
|
is_public=$(ynh_app_setting_get "$app" is_public)
|
||||||
language=$(ynh_app_setting_get "$app" language)
|
language=$(ynh_app_setting_get "$app" language)
|
||||||
|
|
||||||
# Remove trailing "/" for next commands
|
# Remove trailing "/" for next commands
|
||||||
path=${path%/}
|
path_url=${path_url%/}
|
||||||
|
|
||||||
# Copy source files
|
# Copy source files
|
||||||
src_path=/var/www/$app
|
src_path=/var/www/$app
|
||||||
|
@ -30,7 +30,7 @@ sudo chown -R root: $src_path
|
||||||
|
|
||||||
# Modify Nginx configuration file and copy it to Nginx conf directory
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
||||||
nginx_conf=../conf/nginx.conf
|
nginx_conf=../conf/nginx.conf
|
||||||
sed -i "s@YNH_WWW_PATH@$path@g" $nginx_conf
|
sed -i "s@YNH_WWW_PATH@$path_url@g" $nginx_conf
|
||||||
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
|
sed -i "s@YNH_WWW_ALIAS@$src_path/@g" $nginx_conf
|
||||||
# If a dedicated php-fpm process is used:
|
# If a dedicated php-fpm process is used:
|
||||||
#
|
#
|
||||||
|
|
Loading…
Reference in a new issue