From 3c0afdaf52a13799ae7aa12f556884671ee2ebf9 Mon Sep 17 00:00:00 2001 From: Alex Tavarez Date: Mon, 15 Sep 2025 14:27:17 -0400 Subject: [PATCH] Added one of the flag loops to case wherein 'init' subcommand is absent --- zfs/zfs-media-drive.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/zfs/zfs-media-drive.sh b/zfs/zfs-media-drive.sh index e7de594..9a5771b 100644 --- a/zfs/zfs-media-drive.sh +++ b/zfs/zfs-media-drive.sh @@ -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