From 66845630067c30ec3ecfe1c59056fe6f1e93f3fe Mon Sep 17 00:00:00 2001 From: samuel Date: Tue, 2 May 2023 13:30:15 +0200 Subject: [PATCH] [Fix] Check deployer socket in use only when starting --- src/deployer.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/deployer.sh b/src/deployer.sh index 9d6b50d..aa0d2b4 100755 --- a/src/deployer.sh +++ b/src/deployer.sh @@ -363,10 +363,6 @@ main() ( fail "Directory of deployer_sock='${deployer_sock}' is not writable." \ "${err_deployer_sock_dir_not_writable}" fi - if [ -e "${deployer_sock}" ]; then - fail "Sock deployer_sock='${deployer_sock}' is already in use." \ - "${err_deployer_sock_already_in_use}" - fi if [ -z "${repos_dir}" ]; then fail "Variable repos_dir is empty." "${err_repos_dir_empty}" @@ -415,6 +411,11 @@ main() ( exit 0 ;; start) + if [ -e "${deployer_sock}" ]; then + fail "Sock deployer_sock='${deployer_sock}' is already in use." \ + "${err_deployer_sock_already_in_use}" + fi + # Set right access in background after nc listen. ( inotifywait --timeout 1 --quiet --quiet \