42
42
remove () {
43
43
44
44
if [ "${MODE}" = "0" ] ; then
45
+
45
46
bf-echo " .. will remove ${1}*"
47
+
46
48
elif [ "${MODE}" = "1" ] ; then
47
- bf-echo " .. removing ${1}*"
48
- bf-rmrf ${1}* > /dev/null 2>&1
49
+
50
+ bf-echo " .. removing ${1}"
51
+
52
+ if [ -d "${1}" ] ; then
53
+ bf-debug " ${1}/"
54
+ rm -r ${1}
55
+ fi
56
+
57
+ CRT=${1}.crt
58
+ if [ -f "${CRT}" ] ; then
59
+ bf-debug " ${CRT}"
60
+ rm ${CRT}
61
+ fi
62
+
63
+ KEY=${1}.key
64
+ if [ -f "${KEY}" ] ; then
65
+ bf-debug " ${KEY}"
66
+ rm ${KEY}
67
+ fi
68
+
69
+ bf-debug " done"
70
+
49
71
fi
50
72
51
73
}
@@ -70,7 +92,10 @@ SSL_CONFIGS=(${PROXY_SSL_CERTS}/*)
70
92
bf-echo "Checking against configured domains..."
71
93
for CFG in "${SSL_CONFIGS[@]}" ; do
72
94
73
- # do nothing if this is a file
95
+ # do nothing if CFG doesn't exist any more - which means it's been deleted by the script
96
+ [[ ! -d "${CFG}" ]] && [[ ! -f "${CFG}" ]] && continue
97
+
98
+ # do nothing if CFG is a file
74
99
[[ -f "${CFG}" ]] && continue
75
100
76
101
# get name
@@ -95,7 +120,10 @@ NGINX_CONFIGS=(${PROXY_SITES}/*)
95
120
bf-echo "Checking against configured domains..."
96
121
for CFG in "${NGINX_CONFIGS[@]}" ; do
97
122
98
- # do nothing if this is a file
123
+ # do nothing if CFG doesn't exist any more - which means it's been deleted by the script
124
+ [[ ! -d "${CFG}" ]] && [[ ! -f "${CFG}" ]] && continue
125
+
126
+ # do nothing if CFG is a file
99
127
[[ -f "${CFG}" ]] && continue
100
128
101
129
# get name and strip .d from end of directory
0 commit comments