mirror of
https://github.com/YunoHost-Apps/framagames_ynh.git
synced 2024-09-03 18:36:28 +02:00
cleaning
This commit is contained in:
parent
e2bf8c49c5
commit
bc539cfe7c
1 changed files with 0 additions and 72 deletions
|
@ -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
|
Loading…
Add table
Reference in a new issue