fixed battle net from exiting script

This commit is contained in:
Roy 2024-06-19 00:51:52 -07:00 committed by GitHub
parent 44ef2f0dba
commit 3bf61fcda1
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1154,14 +1154,15 @@ if [[ $options == *"Battle.net"* ]]; then
max_attempts=20
attempt=0
while true; do
if pgrep -f "Battle.net.exe" || pgrep -f "BlizzardError.exe" > /dev/null; then
if pgrep -f "Battle.net.exe" > /dev/null || pgrep -f "BlizzardError.exe" > /dev/null; then
pkill -f "Battle.net.exe" || pkill -f "BlizzardError.exe"
break
fi
sleep 1
((attempt++))
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Timeout: Battle.net process did not terminate."
sleep 5
((attempt++))
if [ "$attempt" -ge "$max_attempts" ]; then
echo "Timeout: Battle.net process did not terminate."
break
fi
else
break
fi
done