From 41d1aa41bf0b355d4217464ba360a7c6639d4b04 Mon Sep 17 00:00:00 2001 From: Gardais Jeremy Date: Fri, 27 Nov 2015 14:22:28 +0100 Subject: [PATCH] ldap1_connection: ensure to grep only the port 389 -> use ":389". --- ldap1_connection.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ldap1_connection.sh b/ldap1_connection.sh index 3f4bfe1..4ea4843 100755 --- a/ldap1_connection.sh +++ b/ldap1_connection.sh @@ -7,13 +7,13 @@ # List LDAP connections without: # LISTEN # 129.20.123.1 server -ss_cmd=$(ss -laputen | grep 389 | grep -v 129.20.123.1 | grep -v LISTEN) +ss_cmd=$(ss -laputen | grep ":389" | grep -v 129.20.123.1 | grep -v LISTEN) # email recipient mail_recip="jeremy.gardais@univ-rennes1.fr" if [ "${ss_cmd}" ]; then - ss -laputen | grep 389 | grep -v 129.20.123.1 | grep -v LISTEN | mail -s "LDAP1 connections" "${mail_recip}" + ss -laputen | grep ":389" | grep -v 129.20.123.1 | grep -v LISTEN | mail -s "LDAP1 connections" "${mail_recip}" fi exit 0