ldap1_connection: ensure to grep only the port 389 -> use ":389".

This commit is contained in:
Jeremy Gardais 2015-11-27 14:22:28 +01:00 committed by Gardais Jérémy
parent 78a2800151
commit 41d1aa41bf
1 changed files with 2 additions and 2 deletions

View File

@ -7,13 +7,13 @@
# List LDAP connections without: # List LDAP connections without:
# LISTEN # LISTEN
# 129.20.123.1 server # 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 # email recipient
mail_recip="jeremy.gardais@univ-rennes1.fr" mail_recip="jeremy.gardais@univ-rennes1.fr"
if [ "${ss_cmd}" ]; then 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 fi
exit 0 exit 0