mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-11-22 16:24:05 +01:00
Handle case where no files to cleanup exists.
This fixes cases where "*.foo" expands to the string "*.foo" if no matching files exist.
This commit is contained in:
1 parent
f6e6c1f173
commit
ac2d8303f1
1 file changed
+3
@@ -701,6 +701,9 @@ command_cleanup() {
|
||||
|
||||
# Loop over all files of this type
|
||||
for file in "${certdir}/${filebase}-"*".${fileext}"; do
|
||||
# Handle case where no files match the wildcard
|
||||
[[ -f "${file}" ]] || break
|
||||
|
||||
# Check if current file is in use, if unused move to archive directory
|
||||
filename="$(basename "${file}")"
|
||||
if [[ ! "${filename}" = "${current}" ]]; then
|
||||
|
||||
Reference in new issue
Block a user