From 946d50fbb81468936a0bd86b8899f9ac30fde540 Mon Sep 17 00:00:00 2001
From: David Beniamine <david.beniamine@tetras-libre.fr>
Date: Wed, 7 Feb 2018 11:45:32 +0100
Subject: [PATCH] Deploy script to limit number of samba opens

---
 deploy.sh | 4 ++++
 1 file changed, 4 insertions(+)
 mode change 100644 => 100755 deploy.sh

diff --git a/deploy.sh b/deploy.sh
old mode 100644
new mode 100755
index 83bf8b2f..af0372aa
--- a/deploy.sh
+++ b/deploy.sh
@@ -5,3 +5,7 @@ then
     exit 1
 fi
 DIR=`dirname $0`
+# Update lcs-smb-config then run it to force max connections to 1
+awk 'BEGIN{PRINT=1;FOUND=0} /^[";]*$/{if(IN){IN=0;if(FOUND==0){print "\tmax connections = 1";FOUND=1}}} /^\[homes\]/{IN=1} /max connections/{if(IN){FOUND=1;PRINT=0; print "\tmax connections = 1"}} {if(PRINT){print $0};PRINT=1}' /usr/share/lcs/sbin/lcs-smb-config > /usr/share/lcs/sbin/lcs-smb-config.new
+cp /usr/share/lcs/sbin/lcs-smb-config.new /usr/share/lcs/sbin/lcs-smb-config
+/usr/share/lcs/sbin/lcs-smb-config
-- 
GitLab