Added one of the flag loops to case wherein 'init' subcommand is absent

This commit is contained in:
Alex Tavarez
2025-09-15 14:27:17 -04:00
parent 8266185bbd
commit 3c0afdaf52

View File

@@ -64,13 +64,6 @@ print_menu () {
echo "Placeholder content"
}
while getopts "h" flag; do
case "$flag" in
h) print_menu;;
*) exit 1;;
esac
done
if ! [ -z "$1" ] && [ "$1" == "init" ]; then
while getopts "d:p:k:f:c:v:" opt; do
case $opt in
@@ -91,4 +84,11 @@ if ! [ -z "$1" ] && [ "$1" == "init" ]; then
create_zpool "$ZFS_TARGET_DRIVE" "$ZFS_POOL_NAME" "$ZFS_COMPAT" "$ZFS_KEY_LOC" "$ZFS_KEY_FORMAT" "$ZFS_COMPRESSION"
create_datasets "$ZFS_POOL_NAME"
else
while getopts "h" flag; do
case "$flag" in
h) print_menu;;
*) exit 1;;
esac
done
fi