Merge pull request #144 from no-boot-device/patch-11
Add auto-detection to ./attach-pid
This commit is contained in:
commit
57c8c8adfc
@ -1,8 +1,9 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
proc=$1
|
proc=${1:-$(ps $(pidof gameoverlayui) | tail -n1 | cut -d\- -f2 | cut -d\ -f2)}
|
||||||
|
if ! [[ $proc =~ ^[0-9]+$ ]]; then
|
||||||
echo Attaching to "$proc"
|
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
|
if grep -q "$(realpath bin/libcathook.so)" /proc/"$proc"/maps; then
|
||||||
echo already loaded
|
echo already loaded
|
||||||
|
Reference in New Issue
Block a user