File tree Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Expand file tree Collapse file tree 2 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -43,8 +43,10 @@ create_file_if_needed() {
43
43
# Find any file starting with ${prefix}_ in MODULEPATH and copy it to MODPATH
44
44
source_file=$( find " $MODULE_PATH " -name " ${prefix} _*" -print -quit)
45
45
if [ -n " $source_file " ]; then
46
- cp " $source_file " " $target "
47
- ui_print " [+] Copied from MODULE_PATH to MODPATH: $target "
46
+ cp " $source_file " " $MODPATH /"
47
+
48
+ file_name=$( basename " $source_file " )
49
+ ui_print " [+] Copied from $MODULE_PATH to $MODPATH : $file_name "
48
50
fi
49
51
else
50
52
ui_print " [-] Skipping $target : file already exists."
69
71
70
72
# Always create rmnet_data_cubic unless another exists
71
73
create_file_if_needed " rmnet_data" " cubic"
74
+
75
+ if check_exists_anywhere " kill" ; then
76
+ # If file exists and KSU is true, copy any file from MODULEPATH with the same prefix
77
+ if [ " $KSU " = true ]; then
78
+ # Find any file starting with ${prefix}_ in MODULEPATH and copy it to MODPATH
79
+ source_file=$( find " $MODULE_PATH " -name " kill_connections" -print -quit)
80
+ if [ -n " $source_file " ]; then
81
+ cp " $source_file " " $MODPATH /"
82
+ ui_print " [+] Copied from $MODULE_PATH to $MODPATH : kill_connections"
83
+ fi
84
+ else
85
+ ui_print " [-] Skipping $MODPATH /kill_connections: file already exists."
86
+ fi
87
+ fi
Original file line number Diff line number Diff line change @@ -6,6 +6,9 @@ FLAGFILE="/dev/.tcp_module_log_cleared"
6
6
MAX_LOG_LINES=200
7
7
DEBOUNCE_TIME=10
8
8
9
+ # Get the list of available congestion control algorithms
10
+ congestion_algorithms=$( cat /proc/sys/net/ipv4/tcp_available_congestion_control)
11
+
9
12
# Clear log on first run after boot
10
13
if [ ! -f " $FLAGFILE " ]; then
11
14
rm -f " $LOGFILE " > /dev/null 2>&1
@@ -103,7 +106,7 @@ while true; do
103
106
if [ " $(( current_time - change_time)) " -ge " $DEBOUNCE_TIME " ]; then
104
107
applied=0
105
108
if [ " $new_mode " = " Wi-Fi" ]; then
106
- for algo in bbr reno cubic ; do
109
+ for algo in $congestion_algorithms ; do
107
110
if [ -f " $MODPATH /wlan_$algo " ]; then
108
111
set_congestion " $algo " " $new_mode "
109
112
applied=1
@@ -112,7 +115,7 @@ while true; do
112
115
done
113
116
[ " $applied " -eq 0 ] && set_congestion cubic " $new_mode "
114
117
elif [ " $new_mode " = " Cellular" ]; then
115
- for algo in bbr reno cubic ; do
118
+ for algo in $congestion_algorithms ; do
116
119
if [ -f " $MODPATH /rmnet_data_$algo " ]; then
117
120
set_congestion " $algo " " $new_mode "
118
121
applied=1
You can’t perform that action at this time.
0 commit comments