mirror of
https://github.com/YunoHost-Apps/nextcloud_ynh.git
synced 2024-09-03 19:55:57 +02:00
ownCloud 9.0 comes with improved occ which allows to install easily from the command-line. This install rewrite uses those new facilities and also uses the config:import command to set system and LDAP configuration.
36 lines
908 B
Bash
Executable file
36 lines
908 B
Bash
Executable file
#!/bin/bash
|
|
|
|
# Set app specific variables
|
|
app=${!#}
|
|
dbname=$app
|
|
dbuser=$app
|
|
|
|
# Load common variables and helpers
|
|
. ./_common.sh
|
|
|
|
# Source app helpers
|
|
. /usr/share/yunohost/helpers
|
|
|
|
# Drop MySQL database and user
|
|
ynh_mysql_drop_db $dbname || true
|
|
ynh_mysql_drop_user $dbuser || true
|
|
|
|
# Retrieve domain from app settings
|
|
domain=$(ynh_app_setting_get $app domain)
|
|
|
|
# Delete app directory and configurations
|
|
sudo rm -rf "/var/www/${app}"
|
|
sudo rm -f "/etc/php5/fpm/pool.d/${app}.conf"
|
|
[[ -n $domain ]] && sudo rm -f "/etc/nginx/conf.d/${domain}.d/${app}.conf"
|
|
|
|
# Reload services
|
|
sudo service php5-fpm restart || true
|
|
sudo service nginx reload || true
|
|
|
|
# Remove app dependencies and system user
|
|
ynh_package_autoremove "$DEPS_PKG_NAME" || true
|
|
for i in $(ls /home); do
|
|
[[ ! $i == yunohost.* ]] \
|
|
&& sudo setfacl -x g:$app:rwx > /dev/null 2>&1
|
|
done
|
|
sudo deluser --quiet --remove-home --system $app > /dev/null
|