diff --git a/setup.sh b/setup.sh index 37389ec..a04fe11 100644 --- a/setup.sh +++ b/setup.sh @@ -127,6 +127,13 @@ function select_part () { return 0 } +function no_zpool_exists () { + declare zpool_list + zpool_list="$(zpool list -H)" + [[ "$(wc -l <<<"${zpool_list}")" -le '1' ]] && [[ "$(wc -c <<<"${zpool_list}")" -le '1' ]] && return 0 + return 1 +} + function set_zpool_password () { # May or may not have a newline at the end, ZFS doesn't care printf -- '%s' 'password' > '/etc/zfs/'"${zpool_name}"'.key'