remove 1.5 KB
Newer Older
1
#!/bin/bash
2

3
4
5
6
7
#=================================================
# GENERIC START
#=================================================
# IMPORT GENERIC HELPERS
#=================================================
8

9
10
11
12
13
14
15
16
17
18
19
20
21
22
source /usr/share/yunohost/helpers
source _common.sh

#=================================================
# LOAD SETTINGS
#=================================================

app=$YNH_APP_INSTANCE_NAME

domain=$(ynh_app_setting_get $app domain)
path_url=$(ynh_app_setting_get $app path_url)
app_user=$(ynh_app_setting_get $app app_user)
www_path=$(ynh_app_setting_get $app www_path)
opt_path=$(ynh_app_setting_get $app opt_path)
HgO's avatar
HgO committed
23
nginx_path="/etc/nginx/conf.d/$domain.d/$app.conf"
24
25
26
27
28

#=================================================
# STANDARD REMOVE
#=================================================

HgO's avatar
HgO committed
29
ynh_script_progression "Removing static site..."
30

HgO's avatar
HgO committed
31
rm -rf "$www_path"
HgO's avatar
HgO committed
32
rm -f "$nginx_path"
33

HgO's avatar
HgO committed
34
ynh_script_progression "Removing automatic vpn certificate renewal..."
35

HgO's avatar
HgO committed
36
37
38
39
40
41
42
rm -rf "$opt_path"
rm -rf "/etc/cron.daily/$app-renew-cert"

ynh_script_progression "Reloading Nginx..."

nginx -tq
ynh_systemd_action nginx reload
43
44
45
46
47

#=================================================
# REMOVE DEPENDENCIES
#=================================================

HgO's avatar
HgO committed
48
ynh_script_progression "Removing dependencies..."
49
50
51
52
53
54
55

ynh_remove_app_dependencies

#=================================================
# REMOVE DEDICATED USER
#=================================================

HgO's avatar
HgO committed
56
ynh_script_progression "Removing system user..."
57
ynh_system_user_delete $app_user
58