Add error message to injector if no pid

This commit is contained in:
8dcc 2023-07-26 22:01:33 +02:00
parent 7e46e74b9e
commit 160aba82c1
1 changed files with 6 additions and 1 deletions

View File

@ -3,6 +3,11 @@
pid=$(pidof "hl_linux")
libpath=$(realpath "libhlcheat.so")
if [ "$pid" == "" ]; then
echo "inject.sh: process not running."
exit 1
fi
# Used to echo the command. For debugging.
#set -x
@ -21,7 +26,7 @@ if [ "$1" == "unload" ]; then
-ex "detach" \
-ex "quit"
exit 0;
exit 0
fi
if grep -q "$libpath" "/proc/$pid/maps"; then