-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathservice.sh
More file actions
executable file
·36 lines (36 loc) · 1.08 KB
/
service.sh
File metadata and controls
executable file
·36 lines (36 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#!/system/bin/sh
# by FlyCome
[ ! "$(whoami)" = "root" ] && echo " » 请授予root权限!" && exit 1
######
home_dir="${0%/*}"
######
set=0
while [ "$(getprop sys.boot_completed)" != "1" ]; do
[ "$set" = 60 ] && touch "$home_dir/disable" && exit 1
set=$((set + 1))
sleep 10
done
######
if [ -d "/data/adb/magisk" ]; then
bin_dir="/data/adb/magisk"
elif [ -d "/data/adb/ap" ]; then
bin_dir="/data/adb/ap/bin"
elif [ -d "/data/adb/ksu" ]; then
bin_dir="/data/adb/ksu/bin"
else
echo "Check Bin Directory Error" > "$home_dir/LOG.log"
exit 1
fi
######
chmod +x "$home_dir/AutoDisableServer"
######
if ! pgrep -f "AutoDisableServer"; then
"$home_dir/AutoDisableServer" "$home_dir/CONFIG"
if pgrep -f "AutoDisableServer"; then
echo "AutoDisableServer is Run" > "$home_dir/LOG.log"
echo -n "*/30 * * * * pgrep -f \"AutoDisableServer\" || \"$home_dir/AutoDisableServer\" \"$home_dir/CONFIG\"" > "$home_dir/CRON/root"
"$bin_dir/busybox" crond -c "$home_dir/CRON" &
else
echo "AutoDisableServer Run Error" > "$home_dir/LOG.log"
fi
fi