diff --git a/etc/fail2ban/jail.conf b/etc/fail2ban/jail.conf
index fd69cc76bb4e4e543f8d793da8b41ce8763c6c0f..23a25519a437af70c64ffc9937a06c9018de5474 100644
--- a/etc/fail2ban/jail.conf
+++ b/etc/fail2ban/jail.conf
@@ -441,11 +441,6 @@ port     = http,https
 #
 #
 
-[dolibarr]
-port = http,https
-logpath = /usr/share/dolibarr/documents/dolibarr.log
-enabled = true
-
 [drupal-auth]
 
 port     = http,https
diff --git a/installBase.sh b/installBase.sh
index 34dc9c41d13ebee7b026087d74251fbcca9db2b3..0a7761a551979eaad268676f535536ee4be771f1 100644
--- a/installBase.sh
+++ b/installBase.sh
@@ -1,4 +1,4 @@
-#!/bin/bash - 
+#!/bin/bash -
 #
 # Copyright (C) 2017  Tetras Libre <admin@tetras-libre.fr>
 # Author: Curt, Sebastien <sebastien.curt@tetras-libre.fr>
@@ -112,7 +112,7 @@ cat id_rsa.pub >> /root/.ssh/authorized_keys
 chmod 600  /root/.ssh/authorized_keys
 
 #Fail 2 ban
-cp ./etc/fail2ban/* /etc/fail2ban
+cp ./etc/fail2ban/jail.conf /etc/fail2ban
 systemctl restart fail2ban
 
 #Ssh
diff --git a/upgradeDolibarr.sh b/upgradeDolibarr.sh
index 8bf08ced9ea6515bd4c67debf16bef76eb6a6db8..b464d60c79b0ceadb935d2bc589303af3af24cc4 100644
--- a/upgradeDolibarr.sh
+++ b/upgradeDolibarr.sh
@@ -137,3 +137,19 @@ read -p "Hit enter when you are done with the manual upgrade step"
 echo "En cas d'erreur de type The maximum column sze is 767 bytes, please adapt the following query:"
 echo "ALTER TABLE llx_my_table ROW_FORMAT=DYNAMIC ;"
 echo "After running it, restart the manual upgrade"
+
+#Fail 2 ban
+if [ -n "`dpkg -l | grep fail2ban`" ]
+then
+    echo "Updating fail2ban config for dolibarr"
+    #Fail 2 ban
+    if [ -z "`grep dolibarr  /etc/fail2ban/jail.conf`" ]
+    then
+        echo -e "[dolibarr] \nport = http,https \nlogpath = /usr/share/dolibarr/documents/dolibarr.log \nenabled = true"
+    fi
+    if [ -e /etc/fail2ban/filter.d/dolibarr.conf ]
+    then
+      cp ./etc/fail2ban/filter.d/dolibarr.conf /etc/fail2ban/filter.d
+    fi
+    fail2ban-client reload
+fi