From 34634502d246ea260db472833e9ec0e3ebbe980f Mon Sep 17 00:00:00 2001
From: ZyCromerZ <neetroid97@gmail.com>
Date: Wed, 14 Jun 2023 23:10:28 -0700
Subject: [PATCH] use default MODDIR

Signed-off-by: ZyCromerZ <neetroid97@gmail.com>
---
 service.sh | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/service.sh b/service.sh
index 29b6469..310bdc7 100644
--- a/service.sh
+++ b/service.sh
@@ -10,6 +10,8 @@ do
        sleep 1s
 done
 
+MODDIR=${0%/*}
+
 GetBusyBox="none"
 GetBusyBoxPath="none"
 for i in /system/xbin /system/bin /sbin /su/xbin /data/adb/modules/busybox-ndk/system/xbin /data/adb/modules_update/busybox-ndk/system/xbin /data/adb/modules/busybox-ndk/system/bin /data/adb/modules_update/busybox-ndk/system/bin /data/adb/ksu/bin /data/adb/magisk; do
@@ -44,8 +46,8 @@ TotalTime="30"
 
 for GetTime in 5 5 5 5 1 1 1 1 1 1 1 1 1 1
 do
-    echo "modules will run after $TotalTime s" > $ModulPath/system/etc/ZyC-Core/info/logs.log
-    echo "modules will run after $TotalTime s" > $ModulPath/system/etc/ZyC-Core/info/logs_error.log
+    echo "modules will run after $TotalTime s" > $MODDIR/system/etc/ZyC-Core/info/logs.log
+    echo "modules will run after $TotalTime s" > $MODDIR/system/etc/ZyC-Core/info/logs_error.log
     $GetBusyBox sleep ${GetTime}s
     TotalTime=$(($TotalTime-$GetTime))
 done
@@ -56,7 +58,7 @@ LetsRunService(){
     $GetBusyBox sh $data "$ARGS" &
 }
 
-LetsRunService $ModulPath/system/etc/ZyC-Core/core.sh "BOOTmode='1' ModulPath='$(cat /system/etc/ZyC-Core/info/magisk_path)/$MiD'"
-if [[ -f $ModulPath/system/etc/ZyC-Core/misc/generate-fps.sh ]] && [[ "$(cat $ModulPath/system/etc/ZyC-Core/configs/get_fps_service.conf)" == "1" ]];then
-    LetsRunService $ModulPath/system/etc/ZyC-Core/misc/generate-fps.sh
+LetsRunService $MODDIR/system/etc/ZyC-Core/core.sh "BOOTmode='1' ModulPath='$(cat /system/etc/ZyC-Core/info/magisk_path)/$MiD'"
+if [[ -f $MODDIR/system/etc/ZyC-Core/misc/generate-fps.sh ]] && [[ "$(cat $MODDIR/system/etc/ZyC-Core/configs/get_fps_service.conf)" == "1" ]];then
+    LetsRunService $MODDIR/system/etc/ZyC-Core/misc/generate-fps.sh
 fi
\ No newline at end of file
-- 
GitLab