core145: Update OpenVPN server configuration only when necessary

Message ID 20200603144112.9742-1-michael.tremer@ipfire.org
State New
Headers show
Series
  • core145: Update OpenVPN server configuration only when necessary
Related show

Commit Message

Michael Tremer June 3, 2020, 2:41 p.m. UTC
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
---
 config/rootfiles/core/145/update.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Patch

diff --git a/config/rootfiles/core/145/update.sh b/config/rootfiles/core/145/update.sh
index 893539f30..38653b730 100644
--- a/config/rootfiles/core/145/update.sh
+++ b/config/rootfiles/core/145/update.sh
@@ -78,7 +78,7 @@  for package in perl-DBI perl-DBD-SQLite; do
 done
 
 # Enable OpenVPN metrics collection
-cat <<EOF >> /var/ipfire/ovpn/server.conf
+grep -q "^client-connect" /var/ipfire/ovpn/server.conf || cat <<EOF >> /var/ipfire/ovpn/server.conf
 # Log clients connecting/disconnecting
 client-connect "/usr/sbin/openvpn-metrics client-connect"
 client-disconnect "/usr/sbin/openvpn-metrics client-disconnect"