diff --git a/setup.sh b/setup.sh index 46f1cee..10da6f3 100644 --- a/setup.sh +++ b/setup.sh @@ -87,7 +87,7 @@ function we_have_exactly_one_part () { function no_zpool_exists () { declare zpool_list zpool_list="$(zpool list -H)" - [[ "$(wc -l <<<"${zpool_list}")" -eq '0' ]] && return 0 + [[ "$(wc -l <<<"${zpool_list}")" -le '1' ]] && [[ "$(wc -c <<<"${zpool_list}")" -le '1' ]] && return 0 return 1 } @@ -167,6 +167,9 @@ function setup_zpool () { create_home_dataset export_pool import_pool + else + printf -- '%s\n' 'A zpool already exists, that is unexpected. Cowardly exiting 1 ...' + exit 1 fi }