From 7285aa7cd49aa25686d1d56b8171297adb529ce6 Mon Sep 17 00:00:00 2001 From: Thomas Gebert Date: Wed, 13 May 2026 14:19:25 +0200 Subject: [PATCH] Append --- gluster/check-and-fix-permissions.sh | 99 ++++++++++++++-------------- 1 file changed, 50 insertions(+), 49 deletions(-) diff --git a/gluster/check-and-fix-permissions.sh b/gluster/check-and-fix-permissions.sh index 1c61808..7835aa5 100644 --- a/gluster/check-and-fix-permissions.sh +++ b/gluster/check-and-fix-permissions.sh @@ -49,55 +49,6 @@ HELP exit 0 } -################################################################################ -# Argument parser -################################################################################ -die() { - printf '%s\n' "$1" >&2 - exit 1 -} - -while :; do - case $1 in - -h|-\?|--help) - show_help # Display a usage synopsis. - exit - ;; - -r|--repo) - if [ "$2" ]; then - REPO=$2 - shift - else - die 'ERROR: "-r|--repo" requires a non-empty option argument.' - fi - ;; - -m|--mode) - if [ "$2" ]; then - MODE=$2 - shift - else - die 'ERROR: "-r|--repo" requires a non-empty option argument.' - fi - ;; - -t|--timeout) - if [ "$2" ]; then - TIMEOUT=$2 - shift - else - die 'ERROR: "-t|--timeout" requires a non-empty option argument.' - fi - ;; - --) # End of all options. - shift - break - ;; - *) # Default case: No more options, so break out of the loop. - break - esac - - shift -done - get_bricks() { MY_HOSTNAME=$(echo "${HOSTNAME}" | cut -d '.' -f 1) if ! BRICKS=$(gluster vol info "${REPO}" | grep -i "${MY_HOSTNAME}" | grep -o 'brick[0-9]\+'); then @@ -157,6 +108,56 @@ scan_paths() { done } +################################################################################ +# Argument parser +################################################################################ +die() { + printf '%s\n' "$1" >&2 + exit 1 +} + +while :; do + case $1 in + -h|-\?|--help) + show_help # Display a usage synopsis. + exit + ;; + -r|--repo) + if [ "$2" ]; then + REPO=$2 + shift + else + die 'ERROR: "-r|--repo" requires a non-empty option argument.' + fi + ;; + -m|--mode) + if [ "$2" ]; then + MODE=$2 + shift + else + die 'ERROR: "-r|--repo" requires a non-empty option argument.' + fi + ;; + -t|--timeout) + if [ "$2" ]; then + TIMEOUT=$2 + shift + else + die 'ERROR: "-t|--timeout" requires a non-empty option argument.' + fi + ;; + --) # End of all options. + shift + break + ;; + *) # Default case: No more options, so break out of the loop. + break + esac + + shift +done + + ################################################################################ # Main Main Main ################################################################################