File tree Expand file tree Collapse file tree 1 file changed +19
-4
lines changed
Expand file tree Collapse file tree 1 file changed +19
-4
lines changed Original file line number Diff line number Diff line change @@ -97,10 +97,14 @@ install_coturn() {
9797 apt-get update
9898 apt-get install coturn curl dnsutils -y
9999
100- # Configure system limits
101- echo " fs.file-max = 65535" >> /etc/sysctl.conf
102- sysctl -p
103- ulimit -n 65535
100+ # Configure system limits
101+ echo " fs.file-max = 65535" >> /etc/sysctl.conf
102+ sudo sysctl -p
103+ # Add permanent ulimit settings
104+ echo " * soft nofile 65535" >> /etc/security/limits.conf
105+ echo " * hard nofile 65535" >> /etc/security/limits.conf
106+ echo " root soft nofile 65535" >> /etc/security/limits.conf
107+ echo " root hard nofile 65535" >> /etc/security/limits.conf
104108
105109 # Enable TURN server
106110 echo " TURNSERVER_ENABLED=1" > /etc/default/coturn
141145 systemctl start coturn
142146}
143147
148+ # Swap setup
149+ if [ -f /swapfile ]; then
150+ sudo swapoff -a
151+ sudo rm /swapfile
152+ fi
153+ sudo fallocate -l 16G /swapfile
154+ sudo chmod 600 /swapfile
155+ sudo mkswap /swapfile
156+ sudo swapon /swapfile
157+ echo ' /swapfile none swap sw 0 0' | sudo tee -a /etc/fstab
158+
144159# Main script execution
145160echo " TURN Server Installation and Configuration"
146161echo " ----------------------------------------"
You can’t perform that action at this time.
0 commit comments