From ca4914c63c4d7a4f44d48e6d69e54f53fb0b2495 Mon Sep 17 00:00:00 2001 From: Martin Berghaus Date: Mon, 14 Apr 2025 20:58:54 +0200 Subject: [PATCH] allows leading blanks --- script/monitor/generic/ZFS_SYNC_CHECK.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/script/monitor/generic/ZFS_SYNC_CHECK.sh b/script/monitor/generic/ZFS_SYNC_CHECK.sh index 2f2a33c..6c84aad 100755 --- a/script/monitor/generic/ZFS_SYNC_CHECK.sh +++ b/script/monitor/generic/ZFS_SYNC_CHECK.sh @@ -75,8 +75,8 @@ function checkSync() { for _COMPOSITION_PATH in ${_COMPOSITIONS}*; do # If remote host is found than it is responsible for this container-composition, otherwise skip - # (grep -E "^something" means. Line has to start with "something".) - grep -E "^${_REMOTE_HOSTNAME_SHORT}" "${_COMPOSITION_PATH}/zfssync-hosts" &> /dev/null \ + # (grep -E "^[[:blank:]]*something" means. Line has to start with "something", leading blank chars are ok.) + grep -E "^[[:blank:]]*${_REMOTE_HOSTNAME_SHORT}" "${_COMPOSITION_PATH}/zfssync-hosts" &> /dev/null \ || continue; _COMPOSITION_NAME="${_COMPOSITION_PATH##*/}" #Removes longest matching pattern '*/' from the begin