sunetdrive/templates/application/scan_external_mounts.sh

12 lines
403 B
Bash
Raw Normal View History

2025-02-26 10:32:07 +01:00
#!/bin/bash
# Only run if this is the only instance of this script running
2025-02-26 11:50:34 +01:00
# note: since this script forks to run pgrep, we need -eq 2 here
if [[ $(pgrep -f "${0}" | wc -l) -eq 2 ]]; then
2025-02-26 10:32:07 +01:00
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}"
done
done
fi