From 2c974bd1788d3bc771bba677978eceef35aeda5b Mon Sep 17 00:00:00 2001 From: Micke Nordin Date: Wed, 26 Feb 2025 11:50:34 +0100 Subject: [PATCH] Change guard condition --- templates/application/scan_external_mounts.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/templates/application/scan_external_mounts.sh b/templates/application/scan_external_mounts.sh index cc18148..557daf0 100644 --- a/templates/application/scan_external_mounts.sh +++ b/templates/application/scan_external_mounts.sh @@ -1,7 +1,8 @@ #!/bin/bash # Only run if this is the only instance of this script running -if [[ $(pgrep -f "${0}" | wc -l) -eq 1 ]]; then +# note: since this script forks to run pgrep, we need -eq 2 here +if [[ $(pgrep -f "${0}" | wc -l) -eq 2 ]]; then for container in $(get_containers); do for id in $(nocc "${container}" files_external:list --all --output json | jq '.[].mount_id' | jq .); do nocc "${container}" files_external:scan "${id}"