mirror of
https://github.com/mail-in-a-box/mailinabox.git
synced 2026-09-22 01:57:58 +02:00
Checking file existence using 'if' replaced with shell option 'nullglob' to prevent the following 'for' loop from being entered even when no matching files are present.
This commit is contained in:
+1
-2
@@ -3,8 +3,8 @@
|
||||
|
||||
source /etc/mailinabox.conf
|
||||
shopt -s extglob
|
||||
shopt -s nullglob
|
||||
|
||||
if ls "$STORAGE_ROOT/ssl/"*-+([0-9])-+([0-9a-f]).pem &>/dev/null; then
|
||||
retain_after="$(date --date="7 days ago" +%Y%m%d)"
|
||||
|
||||
mkdir -p $STORAGE_ROOT/ssl.expired
|
||||
@@ -16,4 +16,3 @@ if ls "$STORAGE_ROOT/ssl/"*-+([0-9])-+([0-9a-f]).pem &>/dev/null; then
|
||||
mv "$file" "$STORAGE_ROOT/ssl.expired/${pem}"
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user