mirror of
https://github.com/YunoHost-Apps/strut_ynh.git
synced 2024-09-03 20:26:33 +02:00
34 lines
919 B
Bash
34 lines
919 B
Bash
#!/bin/bash
|
|
APP=${!#}
|
|
|
|
# Retrieve arguments
|
|
domain=$(sudo yunohost app setting $APP domain)
|
|
path=$(sudo yunohost app setting $APP path)
|
|
public_site=$(sudo yunohost app setting $APP public_site)
|
|
|
|
|
|
### Execute potential SQL statements here
|
|
|
|
# Copy files to the right place
|
|
final_path=/var/www/$APP
|
|
sudo mkdir -p $final_path
|
|
sudo cp -a ../sources/* $final_path
|
|
|
|
# Set permissions to roundcube directory
|
|
sudo chown -R www-data: $final_path
|
|
|
|
# Modify Nginx configuration file and copy it to Nginx conf directory
|
|
sed -i "s@PATHTOCHANGE@$path@g" ../conf/nginx.conf*
|
|
sed -i "s@ALIASTOCHANGE@$final_path/@g" ../conf/nginx.conf*
|
|
|
|
sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$APP.conf
|
|
|
|
|
|
# Reload Nginx
|
|
sudo service nginx reload
|
|
sudo yunohost app setting $APP skipped_uris -v "/"
|
|
if [ "$public_site" = "No" ];
|
|
then
|
|
sudo yunohost app setting $APP protected_uris -v "/index.html,/scripts"
|
|
fi
|
|
sudo yunohost app ssowatconf
|