only import if missing

This commit is contained in:
Daniel Hansson 2020-05-01 17:14:42 +02:00 committed by GitHub
parent c33ef63893
commit 3f5d270fef
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -36,7 +36,10 @@ fi
# In either case it's always better to use UUID instead of the /dev/sdX name, so do that as well
# Import zpool in case missing
zpool import -f "$POOLNAME"
if zpool list | grep -q 'no pools available'
then
zpool import -f "$POOLNAME"
fi
# Get UUID
if fdisk -l /dev/sdb1