1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/strut_ynh.git synced 2024-09-03 20:26:33 +02:00
strut_ynh/scripts/install

38 lines
971 B
Bash

#!/bin/bash
APP='strut'
# Retrieve arguments
domain=$1
path=$2
public_site=$3
sudo yunohost app setting $APP public_site -v $public_site
# Check domain/path availability
sudo yunohost app checkurl $domain$path -a $APP
if [[ ! $? -eq 0 ]]; then
exit 1
fi
# 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 and regenerate SSOwat conf
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