mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
Minor enhancements on remove script
This commit is contained in:
parent
dd9b168716
commit
ebb198f3e9
1 changed files with 11 additions and 12 deletions
|
@ -3,21 +3,21 @@
|
||||||
# Load common variables and helpers
|
# Load common variables and helpers
|
||||||
source ./_common.sh
|
source ./_common.sh
|
||||||
|
|
||||||
# Set app specific variables
|
|
||||||
app=$APPNAME
|
|
||||||
dbname=$app
|
|
||||||
dbuser=$app
|
|
||||||
|
|
||||||
# Source app helpers
|
# Source app helpers
|
||||||
source /usr/share/yunohost/helpers
|
source /usr/share/yunohost/helpers
|
||||||
|
|
||||||
|
# Set app specific variables
|
||||||
|
app=$YNH_APP_INSTANCE_NAME
|
||||||
|
dbname=$app
|
||||||
|
dbuser=$app
|
||||||
|
|
||||||
# Remove cron job
|
# Remove cron job
|
||||||
# TODO: Ensure that cron job is not running
|
# TODO: Ensure that cron job is not running
|
||||||
sudo rm -f "/etc/cron.d/${app}"
|
sudo rm -f "/etc/cron.d/${app}"
|
||||||
|
|
||||||
# Drop MySQL database and user
|
# Drop MySQL database and user
|
||||||
ynh_mysql_drop_db "$dbname" 2>/dev/null || true
|
ynh_mysql_drop_db "$dbname"
|
||||||
ynh_mysql_drop_user "$dbuser" 2>/dev/null || true
|
ynh_mysql_drop_user "$dbuser"
|
||||||
|
|
||||||
# Retrieve domain from app settings
|
# Retrieve domain from app settings
|
||||||
domain=$(ynh_app_setting_get "$app" domain)
|
domain=$(ynh_app_setting_get "$app" domain)
|
||||||
|
@ -30,11 +30,11 @@ 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"
|
||||||
|
|
||||||
# Reload services
|
# Reload services
|
||||||
sudo service php5-fpm restart || true
|
sudo service php5-fpm reload
|
||||||
sudo service nginx reload || true
|
sudo service nginx reload
|
||||||
|
|
||||||
# Remove app dependencies
|
# Remove app dependencies
|
||||||
ynh_package_autoremove "$DEPS_PKG_NAME" || true
|
ynh_package_autoremove "$DEPS_PKG_NAME"
|
||||||
|
|
||||||
# Clean home folders ACLs
|
# Clean home folders ACLs
|
||||||
for i in $(ls /home); do
|
for i in $(ls /home); do
|
||||||
|
@ -44,5 +44,4 @@ done
|
||||||
|
|
||||||
# Remove the user account
|
# Remove the user account
|
||||||
id "$app" >/dev/null 2>&1 \
|
id "$app" >/dev/null 2>&1 \
|
||||||
&& sudo deluser --quiet --remove-home "$app" >/dev/null \
|
&& sudo deluser --quiet --remove-home "$app" >/dev/null
|
||||||
|| true
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue