This commit is contained in:
qiaofeng1227 2023-09-21 18:06:35 +08:00
parent e966a5873b
commit 7d048fab6d

View File

@ -4,11 +4,12 @@ set -e
trap "sleep 1; continue" ERR trap "sleep 1; continue" ERR
counter=0 counter=1
while true; do while true; do
set +e set +e
echo Try to get credentia for $counter times
if [ -f "/data/websoft9/credential_git" ]; then if [ -f "/data/websoft9/credential_git" ]; then
echo "/data/websoft9/credential_git is exist" echo "/data/websoft9/credential_git is exist"
else else
@ -38,14 +39,15 @@ while true; do
fi fi
if [ -f "/data/websoft9/credential_git" ] && [ -f "/data/websoft9/credential_deployment" ] && [ -f "/data/websoft9/credential_proxy" ]; then if [ -f "/data/websoft9/credential_git" ] && [ -f "/data/websoft9/credential_deployment" ] && [ -f "/data/websoft9/credential_proxy" ]; then
exit 0 break
else else
if [ $counter -gt 30 ]; then if [ $counter -gt 30 ]; then
echo "Systemd can not get all credentials by excuting 30 times" echo "Systemd can not get all credentials by excuting 30 times"
exit 1 break
fi fi
fi fi
set -e set -e
sleep 3 sleep 3
done done
tail -f /dev/null