From f2451118c4883eba92d362d2cd3ca4de8c013f45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=A9r=C3=A9my=20Dubois?= Date: Mon, 19 Feb 2024 10:37:31 +0100 Subject: [PATCH] ospf, bgp: fix checks scripts --- CHANGELOG | 1 + roles/bgp/templates/bgpd-check-peers.sh.j2 | 3 +-- roles/ospf/templates/ospf6d-check-peers.sh.j2 | 3 +-- roles/ospf/templates/ospfd-check-peers.sh.j2 | 3 +-- 4 files changed, 4 insertions(+), 6 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 53a00b0..d364087 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -102,6 +102,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 * accounts: configure user home, ssh keys and groups only if it already exists, so that there is no error when run in check mode and user doesn't exist yet * collectd: fix rights for collectd directory * etc-git: Remove deprecated/unsupported "warn" parameter +* ospf, bgp: fix checks scripts ### Removed diff --git a/roles/bgp/templates/bgpd-check-peers.sh.j2 b/roles/bgp/templates/bgpd-check-peers.sh.j2 index e81466b..de99994 100755 --- a/roles/bgp/templates/bgpd-check-peers.sh.j2 +++ b/roles/bgp/templates/bgpd-check-peers.sh.j2 @@ -9,8 +9,6 @@ # If it did, we send a mail with the states of the different sessions. -set -u - PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:. _MAILTO="{{ bgp_mailto }}" @@ -30,6 +28,7 @@ mkdir -p "${_TMPDIR}" # Don't try to run if it's already running if [ -e "${_PIDFILE}" ]; then echo "$(date)" >> "${_TMPDIR}"/log + echo "ERROR : $0 already has a PIDFILE" exit 1 else echo $$ >> "${_PIDFILE}" diff --git a/roles/ospf/templates/ospf6d-check-peers.sh.j2 b/roles/ospf/templates/ospf6d-check-peers.sh.j2 index d484ac5..73ac1d0 100755 --- a/roles/ospf/templates/ospf6d-check-peers.sh.j2 +++ b/roles/ospf/templates/ospf6d-check-peers.sh.j2 @@ -9,8 +9,6 @@ # If it did, we send a mail with the states of the different sessions. -set -u - PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:. _MAILTO="{{ ospf_mailto }}" @@ -31,6 +29,7 @@ mkdir -p "${_TMPDIR}" # Don't try to run if it's already running if [ -e "${_PIDFILE}" ]; then echo "$(date)" >> "${_TMPDIR}"/log + echo "ERROR : $0 already has a PIDFILE" exit 1 else echo $$ >> "${_PIDFILE}" diff --git a/roles/ospf/templates/ospfd-check-peers.sh.j2 b/roles/ospf/templates/ospfd-check-peers.sh.j2 index b7d7137..a8589af 100755 --- a/roles/ospf/templates/ospfd-check-peers.sh.j2 +++ b/roles/ospf/templates/ospfd-check-peers.sh.j2 @@ -9,8 +9,6 @@ # If it did, we send a mail with the states of the different sessions. -set -u - PATH=$HOME/bin:/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:. _MAILTO="{{ ospf_mailto }}" @@ -31,6 +29,7 @@ mkdir -p "${_TMPDIR}" # Don't try to run if it's already running if [ -e "${_PIDFILE}" ]; then echo "$(date)" >> "${_TMPDIR}"/log + echo "ERROR : $0 already has a PIDFILE" exit 1 else echo $$ >> "${_PIDFILE}"