diff --git a/scripts/install.save b/scripts/install.save deleted file mode 100644 index 3a5c80a..0000000 --- a/scripts/install.save +++ /dev/null @@ -1,72 +0,0 @@ -#!/bin/bash - -# Retrieve arguments -app=webapp_multi_inst -domain=$1 -path=$2 -is_public=$3 - -sudo yunohost app setting $app path -v $path - -if [ $path = "/" ] -then - sitename="root" -else - # sitename == path without any "/" - sitename=$(echo $path | cut -d '/' -f 2) - # Removal of trailing / - # path can be null but not really an issue for the remaining commands - path=${path%/} -fi - -final_path=/var/www/webapp\_multi/$domain/$sitename - -# Check domain/path availability -sudo yunohost app checkurl $domain$path -a $app -if [[ ! $? -eq 0 ]]; then - exit 1 -fi - -sudo yunohost app setting $app final_path -v $final_path -#sudo yunohost app setting $app domain -v $domain -sudo yunohost app setting $app sitename -v $sitename - -# Creation of folder -#sudo rm -rf $final_path -sudo mkdir -p $final_path - -# Base site -sudo cp ../sources/index.html $final_path/ - -# Set permissions -sudo chmod 775 /var/www/webapp\_multi -sudo chmod 775 /var/www/webapp\_multi/$domain -sudo chmod 775 -R $final_path -sudo chown www-data:www-data /var/www/webapp\_multi -sudo chown www-data:www-data /var/www/webapp\_multi/$domain -sudo chown -hR www-data: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 -sed -i "s@NAMETOCHANGE@$domain\_$sitename@g" ../conf/nginx.conf -sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$sitename.conf - -sed -i "s@NAMETOCHANGE@$domain\_$sitename@g" ../conf/php-fpm.conf -sed -i "s@FOLDERTOCHANGE@webapp\_multi/$domain/$sitename@g" ../conf/php-fpm.conf -finalphpconf=/etc/php5/fpm/pool.d/$domain\_$sitename.conf -sudo cp ../conf/php-fpm.conf $finalphpconf -sudo chown root: $finalphpconf -sudo chmod 644 $finalphpconf - -# Make app public if necessary -sudo yunohost app setting $app is_public -v "$is_public" -if [ "$is_public" = "Yes" ]; -then - sudo yunohost app setting $app skipped_uris -v "/" -fi - -# Reload Nginx and regenerate SSOwat conf -sudo service php5-fpm restart -sudo service nginx reload -sudo yunohost app ssowatconf