mirror of
https://github.com/kevinveenbirkenbach/computer-playbook.git
synced 2024-11-26 06:31:04 +01:00
Implemented error for dangling volumes https://chat.openai.com/share/981ecca4-9df7-4086-b99e-1b60f2632bf6
This commit is contained in:
parent
e96a94bc2d
commit
36fc5f8404
@ -10,7 +10,7 @@ anonymous_volumes=$(docker volume ls --format "{{.Name}}" | grep -E '^[a-f0-9]{6
|
|||||||
|
|
||||||
if [ -z "$anonymous_volumes" ]; then
|
if [ -z "$anonymous_volumes" ]; then
|
||||||
echo "No anonymous volumes found."
|
echo "No anonymous volumes found."
|
||||||
exit $status
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "Anonymous volumes found:"
|
echo "Anonymous volumes found:"
|
||||||
@ -41,4 +41,12 @@ for volume in $anonymous_volumes; do
|
|||||||
done
|
done
|
||||||
done
|
done
|
||||||
|
|
||||||
|
# Additional warning for dangling volumes
|
||||||
|
dangling_volumes=$(docker volume ls -f dangling=true --format "{{.Name}}")
|
||||||
|
if [ -n "$dangling_volumes" ]; then
|
||||||
|
status=2
|
||||||
|
echo "The following dangling volumes were found:"
|
||||||
|
echo "$dangling_volumes"
|
||||||
|
fi
|
||||||
|
|
||||||
exit $status
|
exit $status
|
||||||
|
Loading…
Reference in New Issue
Block a user