1
1
#! /system/bin/sh
2
2
3
- ui_print " - Starting module customization..."
3
+ ui_print " [+] Starting module customization..."
4
4
5
5
# Detect congestion algorithm
6
- ui_print " - Checking TCP congestion algorithm..."
6
+ ui_print " [+] Checking TCP congestion algorithm..."
7
7
if grep -qw bbr /proc/sys/net/ipv4/tcp_available_congestion_control; then
8
8
CONG=" bbr"
9
- ui_print " - Found BBR!"
9
+ ui_print " [+] Found BBR!"
10
10
else
11
11
CONG=" cubic"
12
- ui_print " - BBR not found. Going with Cubic!"
12
+ ui_print " [+] BBR not found. Going with Cubic!"
13
13
fi
14
14
15
15
MODULE_NAME=$( basename " $MODPATH " )
@@ -38,15 +38,25 @@ create_file_if_needed() {
38
38
local target=" $MODPATH /${prefix} _${suffix} "
39
39
40
40
if check_exists_anywhere " $prefix " ; then
41
- ui_print " - Skipping $target : another ${prefix} _* file exists."
41
+ # If file exists and KSU is true, copy any file from MODULEPATH with the same prefix
42
+ if [ " $KSU " = true ]; then
43
+ # Find any file starting with ${prefix}_ in MODULEPATH and copy it to MODPATH
44
+ source_file=$( find " $MODULE_PATH " -name " ${prefix} _*" -print -quit)
45
+ if [ -n " $source_file " ]; then
46
+ cp " $source_file " " $target "
47
+ ui_print " [+] Copied from MODULE_PATH to MODPATH: $target "
48
+ fi
49
+ else
50
+ ui_print " [-] Skipping $target : file already exists."
51
+ fi
42
52
return
43
53
fi
44
54
45
55
if [ ! -f " $target " ]; then
46
56
touch " $target "
47
- ui_print " - Created: $target "
57
+ ui_print " [+] Created: $target "
48
58
else
49
- ui_print " - Skipped: $target already exists"
59
+ ui_print " [-] Skipped: $target already exists"
50
60
fi
51
61
}
52
62
59
69
60
70
# Always create rmnet_data_cubic unless another exists
61
71
create_file_if_needed " rmnet_data" " cubic"
62
-
63
- chmod +x $MODPATH /bin/speedtest
64
- chmod +x $MODPATH /action.sh
0 commit comments