timeout for hanging

This commit is contained in:
Roy 2024-05-17 04:23:54 -07:00 committed by GitHub
parent b49b2db665
commit d77b94ed35
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1029,11 +1029,16 @@ if [[ $options == *"GOG Galaxy"* ]]; then
echo "# Downloading & Installing Gog Galaxy...Please wait..." echo "# Downloading & Installing Gog Galaxy...Please wait..."
# Cancel & Exit the GOG Galaxy Setup Wizard # Cancel & Exit the GOG Galaxy Setup Wizard
end=$((SECONDS+60)) # Timeout after 60 seconds
while true; do while true; do
if pgrep -f "GalaxySetup.tmp" > /dev/null; then if pgrep -f "GalaxySetup.tmp" > /dev/null; then
pkill -f "GalaxySetup.tmp" pkill -f "GalaxySetup.tmp"
break break
fi fi
if [ $SECONDS -gt $end ]; then
echo "Timeout while trying to kill GalaxySetup.tmp"
break
fi
sleep 1 sleep 1
done done
@ -1200,11 +1205,17 @@ if [[ $options == *"Amazon Games"* ]]; then
echo "Running Amazon file using Proton with the /passive option" echo "Running Amazon file using Proton with the /passive option"
"$STEAM_RUNTIME" "${proton_dir}/proton" run "$amazon_file" & "$STEAM_RUNTIME" "${proton_dir}/proton" run "$amazon_file" &
# Cancel & Exit the Amazon Games Setup Wizard
end=$((SECONDS+60)) # Timeout after 60 seconds
while true; do while true; do
if pgrep -f "Amazon Games.exe" > /dev/null; then if pgrep -f "Amazon Games.exe" > /dev/null; then
pkill -f "Amazon Games.exe" pkill -f "Amazon Games.exe"
break break
fi fi
if [ $SECONDS -gt $end ]; then
echo "Timeout while trying to kill Amazon Games.exe"
break
fi
sleep 1 sleep 1
done done
@ -1252,16 +1263,33 @@ if [[ $options == *"EA App"* ]]; then
# Run the EA App file using Proton with the /passive option # Run the EA App file using Proton with the /passive option
echo "Running EA App file using Proton with the /passive option" echo "Running EA App file using Proton with the /passive option"
"$STEAM_RUNTIME" "$proton_dir/proton" run "$eaapp_file" "/quiet" & "$STEAM_RUNTIME" "$proton_dir/proton" run "$eaapp_file" "/quiet" &
end=$((SECONDS+60))
while true; do while true; do
if pgrep -f "EADesktop.exe" > /dev/null; then if pgrep -f "EADesktop.exe" > /dev/null; then
pkill -f "EADesktop.exe" pkill -f "EADesktop.exe"
break break
fi fi
if [ $SECONDS -gt $end ]; then
echo "Timeout while trying to kill EADesktop.exe"
break
fi
sleep 1 sleep 1
done done
# Wait for the Amazon file to finish running # Wait for the EA App file to finish running
echo "Attempting to kill EAappInstaller.exe"
end=$((SECONDS+10))
while true; do
if pgrep -f "EAappInstaller.exe" > /dev/null; then
pkill -f "EAappInstaller.exe"
break
fi
if [ $SECONDS -gt $end ]; then
echo "Timeout while trying to kill EAappInstaller.exe"
break
fi
sleep 1
done
wait wait
fi fi
@ -1307,12 +1335,16 @@ if [[ $options == *"itch.io"* ]]; then
# Run the itchio file using Proton with the /passive option # Run the itchio file using Proton with the /passive option
echo "Running itchio file using Proton with the /passive option" echo "Running itchio file using Proton with the /passive option"
"$STEAM_RUNTIME" "$proton_dir/proton" run "$itchio_file" --silent "$STEAM_RUNTIME" "$proton_dir/proton" run "$itchio_file" --silent
end=$((SECONDS+60))
while true; do while true; do
if pgrep -f "itch.exe" > /dev/null; then if pgrep -f "itch.exe" > /dev/null; then
pkill -f "itch.exe" pkill -f "itch.exe"
break break
fi fi
if [ $SECONDS -gt $end ]; then
echo "Timeout while trying to kill itch.exe"
break
fi
sleep 1 sleep 1
done done