From 160aba82c13955b2a1615262858697491f28498f Mon Sep 17 00:00:00 2001 From: 8dcc <8dcc.git@gmail.com> Date: Wed, 26 Jul 2023 22:01:33 +0200 Subject: [PATCH] Add error message to injector if no pid --- inject.sh | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/inject.sh b/inject.sh index 931c3c6..6401ba9 100755 --- a/inject.sh +++ b/inject.sh @@ -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