From 8b278ede4e7076c14bb3b64f71d9c009247e09d7 Mon Sep 17 00:00:00 2001 From: JRGTH Date: Fri, 20 Jun 2025 00:06:37 -0400 Subject: [PATCH] Fix export cmd with predefined/default options --- usr/local/share/bastille/export.sh | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/usr/local/share/bastille/export.sh b/usr/local/share/bastille/export.sh index ebbfdb24..44bcd0b9 100644 --- a/usr/local/share/bastille/export.sh +++ b/usr/local/share/bastille/export.sh @@ -93,36 +93,43 @@ if [ -n "${bastille_export_options}" ]; then info "Default export option(s): '${DEFAULT_EXPORT_OPTS}'" + # Don't shift here when default export options are explicitly denoted in the config file, hence TARGET will always be $1. for opt in ${DEFAULT_EXPORT_OPTS}; do case "${opt}" in + -a|--auto) + AUTO="1" + ;; --gz) GZIP_EXPORT="1" opt_count - shift;; + ;; --xz) XZ_EXPORT="1" opt_count - shift;; + ;; --tgz) TGZ_EXPORT="1" opt_count zfs_enable_check - shift;; + ;; --txz) TXZ_EXPORT="1" opt_count zfs_enable_check - shift;; + ;; -s|--safe) SAFE_EXPORT="1" - shift;; + ;; -r|--raw) RAW_EXPORT="1" opt_count - shift ;; + ;; -v|--verbose) OPT_ZSEND="-Rv" - shift;; + ;; + -x) + enable_debug + ;; -*) error_notify "[ERROR]: Unknown Option: \"${1}\"" usage;; esac @@ -179,7 +186,7 @@ else enable_debug shift ;; - -*) + -*) for _opt in $(echo ${1} | sed 's/-//g' | fold -w1); do case ${_opt} in a) AUTO=1 ;;