mirror of
https://github.com/YunoHost-Apps/framagames_ynh.git
synced 2024-09-03 18:36:28 +02:00
Storage in subfolder for cleaner approach
This commit is contained in:
parent
75ae8bf38e
commit
ab802485cd
3 changed files with 21 additions and 12 deletions
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app=webapp_multi
|
app=webapp_multi_inst
|
||||||
domain=$1
|
domain=$1
|
||||||
path=$2
|
path=$2
|
||||||
user=$3
|
user=$3
|
||||||
|
@ -15,7 +15,7 @@ then
|
||||||
sitename="root"
|
sitename="root"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
final_path=/var/www/$app\_$domain\_$sitename
|
final_path=/var/www/webapp\_multi/$domain/$sitename
|
||||||
|
|
||||||
|
|
||||||
# Check domain/path availability
|
# Check domain/path availability
|
||||||
|
@ -49,7 +49,7 @@ sudo yunohost app setting $app user -v $user
|
||||||
|
|
||||||
# Creation of folder
|
# Creation of folder
|
||||||
sudo rm -rf $final_path
|
sudo rm -rf $final_path
|
||||||
sudo mkdir $final_path
|
sudo mkdir -p $final_path
|
||||||
|
|
||||||
# Base site
|
# Base site
|
||||||
sudo cp ../sources/index.html $final_path/
|
sudo cp ../sources/index.html $final_path/
|
||||||
|
@ -94,7 +94,9 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$sitename.conf
|
||||||
sudo yunohost app setting $app is_public -v "$is_public"
|
sudo yunohost app setting $app is_public -v "$is_public"
|
||||||
if [ "$is_public" = "Yes" ];
|
if [ "$is_public" = "Yes" ];
|
||||||
then
|
then
|
||||||
sudo yunohost app setting $app skipped_uris -v "/"
|
sudo yunohost app setting $app skipped_uris -v "/"
|
||||||
|
else
|
||||||
|
sudo yunohost app setting $app protected_uris -v "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
app=webapp_multi
|
app=webapp_multi_inst
|
||||||
|
|
||||||
user=$(sudo yunohost app setting $app user)
|
user=$(sudo yunohost app setting $app user)
|
||||||
path=$(sudo yunohost app setting $app path)
|
path=$(sudo yunohost app setting $app path)
|
||||||
|
sitename=$(sudo yunohost app setting $app sitename)
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
domain=$(sudo yunohost app setting $app domain)
|
||||||
final_path=$(sudo yunohost app setting $app final_path)
|
final_path=$(sudo yunohost app setting $app final_path)
|
||||||
|
|
||||||
sitename=$(echo $path | cut -d '/' -f 2)
|
|
||||||
|
|
||||||
# Suppression du dossier de la webapp
|
# Suppression du dossier de la webapp
|
||||||
sudo rm -rf $final_path
|
sudo rm -rf $final_path
|
||||||
|
@ -15,11 +15,16 @@ sudo rm -rf $final_path
|
||||||
# Suppression de la config nginx de la webapp
|
# Suppression de la config nginx de la webapp
|
||||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$sitename.conf
|
sudo rm -f /etc/nginx/conf.d/$domain.d/$sitename.conf
|
||||||
|
|
||||||
# Vérifie si le dossier parent est vide. Ce qui signifie que toutes les webapp ont été désinstallées. Ainsi que le client ftp net2ftp.
|
# We check if folders are empty and if yes we delete them
|
||||||
#if test -z "$(ls $parent_dir | head -n1)"
|
if test -z "$(ls /var/www/webapp_multi/$domain | head -n1)"
|
||||||
#then
|
then
|
||||||
# sudo rmdir $parent_dir
|
sudo rmdir /var/www/webapp_multi/$domain
|
||||||
#fi
|
fi
|
||||||
|
|
||||||
|
if test -z "$(ls /var/www/webapp_multi/ | head -n1)"
|
||||||
|
then
|
||||||
|
sudo rmdir /var/www/webapp_multi
|
||||||
|
fi
|
||||||
|
|
||||||
sudo service nginx reload
|
sudo service nginx reload
|
||||||
sudo yunohost app ssowatconf
|
sudo yunohost app ssowatconf
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
# Retrieve arguments
|
# Retrieve arguments
|
||||||
app=webapp_multi
|
app=webapp_multi_inst
|
||||||
|
|
||||||
domain=$(sudo yunohost app setting $app domain)
|
domain=$(sudo yunohost app setting $app domain)
|
||||||
path=$(sudo yunohost app setting $app path)
|
path=$(sudo yunohost app setting $app path)
|
||||||
|
@ -23,6 +23,8 @@ sudo yunohost app setting $app is_public -v "$is_public"
|
||||||
if [ "$is_public" = "Yes" ];
|
if [ "$is_public" = "Yes" ];
|
||||||
then
|
then
|
||||||
sudo yunohost app setting $app skipped_uris -v "/"
|
sudo yunohost app setting $app skipped_uris -v "/"
|
||||||
|
else
|
||||||
|
sudo yunohost app setting $app protected_uris -v "/"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Reload Nginx and regenerate SSOwat conf
|
# Reload Nginx and regenerate SSOwat conf
|
||||||
|
|
Loading…
Add table
Reference in a new issue