bundles/zfs: print zfs status output if pool is not online

This commit is contained in:
Franzi 2023-08-24 07:41:37 +02:00
parent 33d42e2472
commit bca4d152ea
Signed by: kunsi
GPG key ID: 12E3D2136B818350

View file

@ -5,11 +5,14 @@ if [ $# -eq 0 ] ; then
exit 3
fi
if [ "$(zpool status "$1" | grep '^ state:')" = ' state: ONLINE' ]
status="$(zpool status "$1")"
if [ "$(echo "$status" | grep '^ state:')" = ' state: ONLINE' ]
then
echo "OK - Pool '$1' is online"
exit 0
else
echo "CRITICAL - Pool '$1' is FAULTY or NOT ONLINE"
echo "$status"
exit 2
fi