11#! /system/bin/sh
22
3- ui_print " - Starting module customization..."
3+ ui_print " [+] Starting module customization..."
44
55# Detect congestion algorithm
6- ui_print " - Checking TCP congestion algorithm..."
6+ ui_print " [+] Checking TCP congestion algorithm..."
77if grep -qw bbr /proc/sys/net/ipv4/tcp_available_congestion_control; then
88 CONG=" bbr"
9- ui_print " - Found BBR!"
9+ ui_print " [+] Found BBR!"
1010else
1111 CONG=" cubic"
12- ui_print " - BBR not found. Going with Cubic!"
12+ ui_print " [+] BBR not found. Going with Cubic!"
1313fi
1414
1515MODULE_NAME=$( basename " $MODPATH " )
@@ -38,15 +38,25 @@ create_file_if_needed() {
3838 local target=" $MODPATH /${prefix} _${suffix} "
3939
4040 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
4252 return
4353 fi
4454
4555 if [ ! -f " $target " ]; then
4656 touch " $target "
47- ui_print " - Created: $target "
57+ ui_print " [+] Created: $target "
4858 else
49- ui_print " - Skipped: $target already exists"
59+ ui_print " [-] Skipped: $target already exists"
5060 fi
5161}
5262
5969
6070# Always create rmnet_data_cubic unless another exists
6171create_file_if_needed " rmnet_data" " cubic"
62-
63- chmod +x $MODPATH /bin/speedtest
64- chmod +x $MODPATH /action.sh
0 commit comments