shfmt
This commit is contained in:
parent
4a270b9f65
commit
3007fc6de4
1 changed files with 12 additions and 12 deletions
|
@ -7,27 +7,27 @@ if [[ $(pgrep -f "${0}" | wc -l) -eq 2 ]]; then
|
||||||
# We sleep a deterministic amount of time, which will be between 0 an 128 m and allways the same within
|
# We sleep a deterministic amount of time, which will be between 0 an 128 m and allways the same within
|
||||||
# a specific host, but will differ between hosts
|
# a specific host, but will differ between hosts
|
||||||
sleep $((16#$(ip a | grep "link/ether" | head -1 | awk -F ':' '{print $6}' | awk '{print $1}') / 2))m
|
sleep $((16#$(ip a | grep "link/ether" | head -1 | awk -F ':' '{print $6}' | awk '{print $1}') / 2))m
|
||||||
errors=''
|
errors=''
|
||||||
for container in $(get_containers); do
|
for container in $(get_containers); do
|
||||||
error_ids="${error_ids} ${container}: "
|
error_ids="${error_ids} ${container}: "
|
||||||
for id in $(nocc "${container}" files_external:list --all --output json | jq '.[].mount_id' | jq .); do
|
for id in $(nocc "${container}" files_external:list --all --output json | jq '.[].mount_id' | jq .); do
|
||||||
nocc "${container}" files_external:scan "${id}" | grep Error
|
nocc "${container}" files_external:scan "${id}" | grep Error
|
||||||
# shellcheck disable=SC2181
|
# shellcheck disable=SC2181
|
||||||
if [[ ${?} -eq 0 ]]; then
|
if [[ ${?} -eq 0 ]]; then
|
||||||
errors="${errors} ${id}"
|
errors="${errors} ${id}"
|
||||||
error_ids="${error_ids} ${id}"
|
error_ids="${error_ids} ${id}"
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
else
|
else
|
||||||
echo "Another instance of this script is already running, exiting"
|
echo "Another instance of this script is already running, exiting"
|
||||||
pgrep -a -f "${0}"
|
pgrep -a -f "${0}"
|
||||||
exit 0
|
exit 0
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [[ -n "${errors}" ]]; then
|
if [[ -n "${errors}" ]]; then
|
||||||
echo "Errors found in the following mounts: ${error_ids}"
|
echo "Errors found in the following mounts: ${error_ids}"
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
echo "No errors found"
|
echo "No errors found"
|
||||||
exit 0
|
exit 0
|
||||||
|
|
Loading…
Add table
Reference in a new issue