-
Notifications
You must be signed in to change notification settings - Fork 66
/
Copy pathremove
executable file
·43 lines (32 loc) · 1.22 KB
/
remove
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
#!/bin/bash
source _common.sh
source /usr/share/yunohost/helpers
#=================================================
# REMOVE SYSTEM CONFIGURATIONS
#=================================================
ynh_script_progression "Removing system configurations related to $app..."
ynh_config_remove_fail2ban
ynh_config_remove_logrotate
ynh_config_remove_nginx
ynh_safe_rm "/etc/nginx/conf.d/$domain.d/$app.d"
ynh_config_remove_phpfpm
# Remove notify push
if [ $enable_notify_push -eq 1 ]; then
ynh_config_remove_systemd"${app}-notify-push"
systemctl disable --now --quiet ${app}-notify-push-watcher.path
ynh_safe_rm "/etc/systemd/system/${app}-notify-push-watcher.path"
ynh_config_remove_systemd"${app}-notify-push-watcher"
fi
# 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 path in /home/*; do
# Clean ACL in every directories in /home, except those which start with 'yunohost.'
[[ ! $path == /home/yunohost.* ]] \
&& setfacl --remove g:$app -- "$path" 2>&1
done
#=================================================
# END OF SCRIPT
#=================================================
ynh_script_progression "Removal of $app completed"