mirror of
https://github.com/docker-mailserver/docker-mailserver.git
synced 2025-07-28 06:35:06 +02:00
Change 'function' style (#3364)
This commit is contained in:
parent
cf74127f78
commit
37ca0f9ba9
60 changed files with 233 additions and 466 deletions
|
@ -7,8 +7,7 @@ SCRIPT_NAME=$(basename "$0")
|
|||
# prevent removal by other instances of docker-mailserver
|
||||
LOCK_ID=$(uuid)
|
||||
|
||||
function _create_lock
|
||||
{
|
||||
function _create_lock() {
|
||||
LOCK_FILE="/tmp/docker-mailserver/${SCRIPT_NAME}.lock"
|
||||
while [[ -e "${LOCK_FILE}" ]]
|
||||
do
|
||||
|
@ -28,8 +27,7 @@ function _create_lock
|
|||
echo "${LOCK_ID}" >"${LOCK_FILE}"
|
||||
}
|
||||
|
||||
function _remove_lock
|
||||
{
|
||||
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}"; then # Ensure we don't delete a lock that's not ours
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue