allows leading blanks

This commit is contained in:
Martin Berghaus
2025-04-14 20:58:54 +02:00
parent e3f3be3725
commit ca4914c63c

View File

@@ -75,8 +75,8 @@ function checkSync() {
for _COMPOSITION_PATH in ${_COMPOSITIONS}*; do for _COMPOSITION_PATH in ${_COMPOSITIONS}*; do
# If remote host is found than it is responsible for this container-composition, otherwise skip # 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 "^[[:blank:]]*something" means. Line has to start with "something", leading blank chars are ok.)
grep -E "^${_REMOTE_HOSTNAME_SHORT}" "${_COMPOSITION_PATH}/zfssync-hosts" &> /dev/null \ grep -E "^[[:blank:]]*${_REMOTE_HOSTNAME_SHORT}" "${_COMPOSITION_PATH}/zfssync-hosts" &> /dev/null \
|| continue; || continue;
_COMPOSITION_NAME="${_COMPOSITION_PATH##*/}" #Removes longest matching pattern '*/' from the begin _COMPOSITION_NAME="${_COMPOSITION_PATH##*/}" #Removes longest matching pattern '*/' from the begin