mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-02 21:44:51 +02:00
change if style (#3361)
This commit is contained in:
parent
0e592aa911
commit
cf74127f78
58 changed files with 297 additions and 594 deletions
|
@ -14,8 +14,7 @@ function _create_lock
|
|||
do
|
||||
# Handle stale lock files left behind on crashes
|
||||
# or premature/non-graceful exits of containers while they're making changes
|
||||
if [[ -n "$(find "${LOCK_FILE}" -mmin +1 2>/dev/null)" ]]
|
||||
then
|
||||
if [[ -n "$(find "${LOCK_FILE}" -mmin +1 2>/dev/null)" ]]; then
|
||||
_log 'warn' 'Lock file older than 1 minute - removing stale lock file'
|
||||
rm -f "${LOCK_FILE}"
|
||||
else
|
||||
|
@ -33,8 +32,7 @@ function _remove_lock
|
|||
{
|
||||
LOCK_FILE="${LOCK_FILE:-"/tmp/docker-mailserver/${SCRIPT_NAME}.lock"}"
|
||||
[[ -z "${LOCK_ID}" ]] && _exit_with_error "Cannot remove '${LOCK_FILE}' as there is no LOCK_ID set"
|
||||
if [[ -e "${LOCK_FILE}" ]] && grep -q "${LOCK_ID}" "${LOCK_FILE}" # Ensure we don't delete a lock that's not ours
|
||||
then
|
||||
if [[ -e "${LOCK_FILE}" ]] && grep -q "${LOCK_ID}" "${LOCK_FILE}"; then # Ensure we don't delete a lock that's not ours
|
||||
rm -f "${LOCK_FILE}"
|
||||
_log 'trace' "Removed lock '${LOCK_FILE}'"
|
||||
fi
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue