Skip to content

Commit 380f2e8

Browse files
authored
v5.0.8 (#110)
Minor updates * Fixing SSL cleanup to remove key / crt files as well as directory
1 parent 776612c commit 380f2e8

File tree

2 files changed

+33
-5
lines changed

2 files changed

+33
-5
lines changed

VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
5.0.7
1+
5.0.8

overlay/usr/bin/bf/ssl-cleanup

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -42,10 +42,32 @@ esac
4242
remove () {
4343

4444
if [ "${MODE}" = "0" ] ; then
45+
4546
bf-echo " .. will remove ${1}*"
47+
4648
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+
4971
fi
5072

5173
}
@@ -70,7 +92,10 @@ SSL_CONFIGS=(${PROXY_SSL_CERTS}/*)
7092
bf-echo "Checking against configured domains..."
7193
for CFG in "${SSL_CONFIGS[@]}" ; do
7294

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
7499
[[ -f "${CFG}" ]] && continue
75100

76101
# get name
@@ -95,7 +120,10 @@ NGINX_CONFIGS=(${PROXY_SITES}/*)
95120
bf-echo "Checking against configured domains..."
96121
for CFG in "${NGINX_CONFIGS[@]}" ; do
97122

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
99127
[[ -f "${CFG}" ]] && continue
100128

101129
# get name and strip .d from end of directory

0 commit comments

Comments
 (0)