Merge pull request #144 from no-boot-device/patch-11

Add auto-detection to ./attach-pid
This commit is contained in:
julianacat 2017-06-03 08:25:00 -05:00 committed by GitHub
commit 57c8c8adfc

View File

@ -1,8 +1,9 @@
#!/usr/bin/env bash
proc=$1
echo Attaching to "$proc"
proc=${1:-$(ps $(pidof gameoverlayui) | tail -n1 | cut -d\- -f2 | cut -d\ -f2)}
if ! [[ $proc =~ ^[0-9]+$ ]]; then
echo "Couldn't find process! Are you sure a game is running?" >&2; exit 1
fi
if grep -q "$(realpath bin/libcathook.so)" /proc/"$proc"/maps; then
echo already loaded