Set tcp_fastopen with echo instead of sysctl

This commit is contained in:
Mygod
2016-08-16 14:48:30 +08:00
parent 80d93a84bd
commit a722257aba
@@ -27,7 +27,7 @@ object TcpFastOpen {
}
def enabled(value: Boolean) = if (supported) {
val fastopen = "sysctl -w net.ipv4.tcp_fastopen=" + (if (value) 3 else 0)
val fastopen = "echo " + (if (value) 3 else 0) + " > /proc/sys/net/ipv4/tcp_fastopen"
Shell.SU.run(Array(
"mount -o remount,rw /system && " + fastopen + " && echo '#!/system/bin/sh\n" + fastopen +
"' > /etc/init.d/tcp_fastopen && chmod 755 /etc/init.d/tcp_fastopen",