forked from Youchie/X-Panel-SSH-User-Management
-
Notifications
You must be signed in to change notification settings - Fork 0
/
TCP-Tweaker
57 lines (57 loc) · 1.68 KB
/
TCP-Tweaker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
tput setaf 7 ; tput setab 4 ; tput bold ; printf '%35s%s%-20s\n' "TCP Tweaker 1.0" ; tput sgr0
if [[ `grep -c "^#PH56" /etc/sysctl.conf` -eq 1 ]]
then
echo ""
echo "TCP Tweaker network settings have already been added to the system!"
echo ""
read -p "Do you want to remove TCP Tweaker settings? [y/n]: " -e -i n resposta0
if [[ "$resposta0" = 'y' ]]; then
grep -v "^#PH56
net.ipv4.tcp_window_scaling = 1
net.core.rmem_max = 16777216
net.core.wmem_max = 16777216
net.ipv4.tcp_rmem = 4096 87380 16777216
net.ipv4.tcp_wmem = 4096 16384 16777216
net.ipv4.tcp_low_latency = 1
net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv /tmp/syscl /etc/sysctl.conf
sysctl -p /etc/sysctl.conf > /dev/null
echo ""
echo "TCP Tweaker network settings were successfully removed."
echo ""
exit
else
echo ""
exit
fi
else
echo ""
echo "This is an experimental script. Use at your own risk!"
echo "This script will change some network settings"
echo "to reduce latency and improve speed."
echo ""
read -p "Proceed with installation? [y/n]: " -e -i n resposta
if [[ "$resposta" = 'y' ]]; then