test_apps/change_url_app_ynh/scripts/install

35 lines
705 B
Text
Raw Normal View History

2017-03-12 02:12:45 +01:00
set -eux
app=$YNH_APP_INSTANCE_NAME
number=$YNH_APP_INSTANCE_NUMBER
# Retrieve arguments
domain=$YNH_APP_ARG_DOMAIN
path=$YNH_APP_ARG_PATH
# Check domain/path availability
yunohost app checkurl $domain$path -a $app
2017-03-12 02:12:45 +01:00
if [[ ! $? -eq 0 ]]; then
exit 1
fi
if [[ "$path" == "" ]]; then
sed -i "s@PATHTOCHANGE@/@g" ../conf/nginx.conf
else
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf
fi
sed -i "s@FOLDER@$app/@g" ../conf/nginx.conf
2017-03-12 02:12:45 +01:00
cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf
2017-03-12 02:12:45 +01:00
mkdir -p /var/www/$app
2017-03-12 02:12:45 +01:00
cp ../conf/index.html /var/www/$app
2017-03-12 02:12:45 +01:00
# Reload Nginx and regenerate SSOwat conf
service nginx reload
2017-03-12 02:12:45 +01:00
yunohost app setting $app unprotected_uris -v "/"
yunohost app ssowatconf