mirror of
https://github.com/YunoHost-Apps/framagames_ynh.git
synced 2024-09-03 18:36:28 +02:00
Update base scripts
This commit is contained in:
parent
cc29309df5
commit
2aa825c3e2
2 changed files with 22 additions and 13 deletions
|
@ -1,6 +1,7 @@
|
|||
#!/bin/bash
|
||||
|
||||
# Retrieve arguments
|
||||
app=webapp_multi
|
||||
domain=$1
|
||||
path=$2
|
||||
user=$3
|
||||
|
@ -14,7 +15,6 @@ then
|
|||
sitename="root"
|
||||
fi
|
||||
|
||||
app=webapp_multi_$domain_$sitename
|
||||
final_path=/var/www/$app_$domain_$sitename
|
||||
|
||||
|
||||
|
@ -24,6 +24,12 @@ 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 path -v $path
|
||||
sudo yunohost app setting $app sitename -v $sitename
|
||||
|
||||
|
||||
# Check user
|
||||
sudo yunohost user list --json | grep -q "\"username\": \"$user\""
|
||||
if [[ ! $? -eq 0 ]]; then
|
||||
|
@ -88,7 +94,7 @@ sudo cp ../conf/nginx.conf /etc/nginx/conf.d/$domain.d/$sitename.conf
|
|||
sudo yunohost app setting $app is_public -v "$is_public"
|
||||
if [ "$is_public" = "Yes" ];
|
||||
then
|
||||
sudo yunohost app setting $app skipped_uris -v "$domain$path"
|
||||
sudo yunohost app setting $app skipped_uris -v "/$domain$path"
|
||||
fi
|
||||
|
||||
# Reload Nginx and regenerate SSOwat conf
|
||||
|
|
|
@ -1,22 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
user=$(sudo yunohost app setting my_webapp user)
|
||||
path=$(sudo yunohost app setting my_webapp path)
|
||||
domain=$(sudo yunohost app setting my_webapp domain)
|
||||
parent_dir=/var/www/webapp_$user
|
||||
name=$(echo $path | cut -d '/' -f 2)
|
||||
final_path=$parent_dir$path
|
||||
app=webapp_multi
|
||||
|
||||
user=$(sudo yunohost app setting $app user)
|
||||
path=$(sudo yunohost app setting $app path)
|
||||
domain=$(sudo yunohost app setting $app domain)
|
||||
final_path=$(sudo yunohost app setting $app final_path)
|
||||
|
||||
sitename=$(echo $path | cut -d '/' -f 2)
|
||||
|
||||
# Suppression du dossier de la webapp
|
||||
sudo rm -rf $final_path
|
||||
|
||||
# Suppression de la config nginx de la webapp
|
||||
sudo rm -f /etc/nginx/conf.d/$domain.d/$name.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.
|
||||
if test -z "$(ls $parent_dir | head -n1)"
|
||||
then
|
||||
sudo rmdir $parent_dir
|
||||
fi
|
||||
#if test -z "$(ls $parent_dir | head -n1)"
|
||||
#then
|
||||
# sudo rmdir $parent_dir
|
||||
#fi
|
||||
|
||||
sudo service nginx reload
|
||||
sudo yunohost app ssowatconf
|
||||
|
|
Loading…
Add table
Reference in a new issue