1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/rainloop_ynh.git synced 2024-09-03 20:16:18 +02:00
This commit is contained in:
polytan02 2017-02-21 22:23:45 +00:00
parent f57a8ab64c
commit f3bb7a61e8
5 changed files with 26 additions and 26 deletions

View file

@ -9,7 +9,7 @@
dbuser=$app dbuser=$app
# Source app helpers # Source app helpers
. /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Retrieve app settings # Retrieve app settings
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
@ -24,7 +24,7 @@
ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf" ynh_backup "/etc/nginx/conf.d/${domain}.d/${app}.conf" "nginx.conf"
# Copy dedicated php-fpm process to backup folder # Copy dedicated php-fpm process to backup folder
ynh_backup "/etc/php5/fpm/pool.d/$app.conf" "php-fpm.conf" ynh_backup "/etc/php5/fpm/pool.d/${app}.conf" "php-fpm.conf"
# Dump the database # Dump the database
mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql mysqldump -u "$dbuser" -p"$dbpass" --no-create-db "$dbname" > ./db.sql

View file

@ -144,5 +144,5 @@
fi fi
# Reload services # Reload services
sudo service php5-fpm restart || true sudo service php5-fpm reload || true
sudo service nginx reload || true sudo service nginx reload || true

View file

@ -5,25 +5,25 @@
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Source app helpers # Source app helpers
. /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Retrieve arguments # Retrieve arguments
dbuser=$app dbuser=$app
dbname=$app dbname=$app
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
# Drop MySQL database and user # Drop MySQL database and user
ynh_mysql_drop_db "$dbname" 2>&1 || true ynh_mysql_drop_db "$dbname" 2>&1 || true
ynh_mysql_drop_user "$dbuser" 2>&1 || true ynh_mysql_drop_user "$dbuser" 2>&1 || true
# Delete app directory and configurations # Delete app directory and configurations
sudo rm -rf "/var/www/${app}" sudo rm -rf "/var/www/${app}"
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf" sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf" [[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
# Remove GPG key # Remove GPG key
sudo gpg --batch --delete-key --yes Rainloop sudo gpg --batch --delete-key --yes Rainloop
# Reload services # Reload services
sudo service php5-fpm restart || true sudo service php5-fpm reload || true
sudo service nginx reload || true sudo service nginx reload || true

View file

@ -1,13 +1,13 @@
#!/bin/bash #!/bin/bash
# Exit on command errors and treat unset variables as an error # Exit on command errors and treat unset variables as an error
set -eu set -eu
# Get multi-instances specific variables # Get multi-instances specific variables
app=$YNH_APP_INSTANCE_NAME app=$YNH_APP_INSTANCE_NAME
# Source app helpers # Source app helpers
. /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Retrieve old app settings # Retrieve old app settings
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
@ -52,5 +52,5 @@ set -eu
sudo cp -a ./php-fpm.conf "$phpfpm_conf" sudo cp -a ./php-fpm.conf "$phpfpm_conf"
# Reload services # Reload services
sudo service php5-fpm restart || true sudo service php5-fpm reload || true
sudo service nginx reload || true sudo service nginx reload || true

View file

@ -21,7 +21,7 @@
trap EXIT_PROPERLY ERR trap EXIT_PROPERLY ERR
# Source app helpers # Source app helpers
. /usr/share/yunohost/helpers source /usr/share/yunohost/helpers
# Retrieve arguments # Retrieve arguments
domain=$(ynh_app_setting_get "$app" domain) domain=$(ynh_app_setting_get "$app" domain)
@ -95,5 +95,5 @@
sudo chmod 644 $finalphpconf sudo chmod 644 $finalphpconf
# Reload services # Reload services
sudo service php5-fpm restart || true sudo service php5-fpm reload || true
sudo service nginx reload || true sudo service nginx reload || true