[Fix] Check deployer socket in use only when starting

This commit is contained in:
samuel 2023-05-02 13:30:15 +02:00
parent f80cf827af
commit 6684563006
1 changed files with 5 additions and 4 deletions

View File

@ -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 \