Update setup.sh - fail setup on multiple zpool detection

This commit is contained in:
tschettervictor
2024-12-03 18:26:49 -07:00
committed by GitHub
parent c8a2b3a784
commit 53bd72a272

View File

@@ -123,6 +123,10 @@ configure_zfs() {
else
## attempt to determine bastille_zroot from `zpool list`
bastille_zroot=$(zpool list | grep -v NAME | awk '{print $1}')
if [ $(echo "${bastille_zroot}" | wc -l) -gt 1 ]; then
error_notify "Error: Multiple zfs pools available:\n"${bastille_zroot}""
error_exit "Set desired pool using \"sysrc -f "${bastille_config}" bastille_zfs_zpool=ZPOOL_NAME\""
fi
sysrc -f "${bastille_config}" bastille_zfs_enable=YES
sysrc -f "${bastille_config}" bastille_zfs_zpool="${bastille_zroot}"
fi