1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/nextcloud_ynh.git synced 2024-09-03 19:55:57 +02:00
nextcloud_ynh/scripts/remove
Éric Gaspar a5308548ab cleaning
2024-07-01 17:35:41 +02:00

41 lines
1.1 KiB
Bash
Executable file

#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
# REMOVE SYSTEMD SERVICE
#=================================================
ynh_script_progression "Removing system configurations related to $app..."
# Remove the dedicated NGINX config
ynh_config_remove_nginx
# Remove the dedicated PHP-FPM config
ynh_config_remove_phpfpm
# Remove the app-specific logrotate config
ynh_config_remove_logrotate
# Remove the dedicated Fail2Ban config
ynh_config_remove_fail2ban
# Remove a cron file
# TODO: Ensure that cron job is not running (How !?)
ynh_safe_rm "/etc/cron.d/$app"
# Cleaning ACL in home directories
for i in $(ls /home); do
# Clean ACL in every directories in /home, except those which start with 'yunohost.'
[[ ! $i == yunohost.* ]] \
&& setfacl --remove g:$app:rwx 2>&1
done
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Removal of $app completed"