mirror of
https://github.com/dehydrated-io/dehydrated.git
synced 2026-07-08 14:05:25 +02:00
Merge pull request #141 from fancycode/null_glob
Handle case where no files to cleanup exist.
This commit is contained in:
@@ -701,6 +701,9 @@ command_cleanup() {
|
|||||||
|
|
||||||
# Loop over all files of this type
|
# Loop over all files of this type
|
||||||
for file in "${certdir}/${filebase}-"*".${fileext}"; do
|
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
|
# Check if current file is in use, if unused move to archive directory
|
||||||
filename="$(basename "${file}")"
|
filename="$(basename "${file}")"
|
||||||
if [[ ! "${filename}" = "${current}" ]]; then
|
if [[ ! "${filename}" = "${current}" ]]; then
|
||||||
|
|||||||
Reference in New Issue
Block a user