fix: Take first PID from pgrep for EGS

This commit is contained in:
Alex Smith
2025-05-29 01:08:56 +05:00
parent 1b0c6c0559
commit 1018c3b2fa

View File

@ -4593,11 +4593,11 @@ portwine_launch () {
while true ; do
sleep 5
if [[ -z "$GAMEPID" ]] ; then
GAMEPID="$(pgrep -fa 'EpicPortal|epicusername|epiclocale|AUTH_LOGIN' | awk '{print $1}')"
GAMEPID="$(pgrep -fa 'EpicPortal|epicusername|epiclocale|AUTH_LOGIN' | awk '{print $1}' | head -n 1)"
else
if waitpid "$GAMEPID" ; then
sleep 1
GAMEPID="$(pgrep -fa 'EpicPortal|epicusername|epiclocale|AUTH_LOGIN' | awk '{print $1}')"
GAMEPID="$(pgrep -fa 'EpicPortal|epicusername|epiclocale|AUTH_LOGIN' | awk '{print $1}' | head -n 1)"
[[ -z "$GAMEPID" ]] && break || continue
fi
fi