Skip to content

Commit 2a7c85c

Browse files
committed
Fix KSU install bug. Copy present Config files to MODPATH
1 parent e04b759 commit 2a7c85c

File tree

3 files changed

+17
-42
lines changed

3 files changed

+17
-42
lines changed

module/action.sh

Lines changed: 0 additions & 32 deletions
This file was deleted.

module/bin/speedtest

-2.42 MB
Binary file not shown.

module/customize.sh

Lines changed: 17 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
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..."
77
if 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!"
1010
else
1111
CONG="cubic"
12-
ui_print "- BBR not found. Going with Cubic!"
12+
ui_print " [+] BBR not found. Going with Cubic!"
1313
fi
1414

1515
MODULE_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

@@ -59,6 +69,3 @@ fi
5969

6070
# Always create rmnet_data_cubic unless another exists
6171
create_file_if_needed "rmnet_data" "cubic"
62-
63-
chmod +x $MODPATH/bin/speedtest
64-
chmod +x $MODPATH/action.sh

0 commit comments

Comments
 (0)