#!/bin/bash # Installation de minchat dans Yunohost app=minchat # Retrieve arguments domain=$1 path=$2 is_public=$3 # 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 with the right permissions final_path=/var/www/$app sudo mkdir -p $final_path sudo cp -a ../sources/* $final_path 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@WWWPATH@$final_path@g" ../conf/nginx.conf sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$app.conf # Make it public is required if [[ $is_public =~ ^[Yy]$ ]] then sudo yunohost app setting $app skipped_uris -v "/" fi # Reload nginx and regenerate SSOwat conf sudo service nginx reload sudo yunohost app ssowatconf