diff --git a/bin/backup b/bin/backup index a051c36..0a71fbe 100755 --- a/bin/backup +++ b/bin/backup @@ -86,6 +86,8 @@ expire_date= archive_prefix= quiet=() +# @formatter:off +# TEMP: remove when https://github.com/lovesegfault/beautysh/issues/265 is fixed while :; do case "${1:-}" in -s | --source) @@ -170,6 +172,7 @@ while :; do esac shift done +# @formatter:on check-root diff --git a/bin/benchmark b/bin/benchmark index 1219989..52ebb40 100755 --- a/bin/benchmark +++ b/bin/benchmark @@ -18,7 +18,7 @@ ############ # Version -version=1.2.4 +version=1.2.5 # Individual benchmark time limit (seconds) # Quick benchmark test_run_time_quick=6 @@ -168,7 +168,7 @@ _cpu-app-test() { ## @param $@ Params for benchmark ##################################### _run-benchmark() { - local type="${1?:Benchmark type missing}" + local type="${1:?Benchmark type missing}" local params=("--time=${test_run_time}") # Compile params @@ -200,8 +200,8 @@ _run-benchmark() { ## @param $2 Raw results ####################################### _filter-results() { - local type="${1?:Benchmark type missing}" - local raw="${2?:Raw results missing}" + local type="${1:?Benchmark type missing}" + local raw="${2:?Raw results missing}" local filter case "${type}" in @@ -362,6 +362,8 @@ report_file_prefix= sys_check= benchmark_depth= params_file= +# @formatter:off +# TEMP: remove when https://github.com/lovesegfault/beautysh/issues/265 is fixed while :; do case "${1:-}" in -r | --report) create_report=1 ;; @@ -399,6 +401,7 @@ while :; do esac shift done +# @formatter:on if [[ -z "${sys_check}" && -z "${benchmark_depth}" ]]; then echo "Benchmark depth missing (quick or full)" >&2 diff --git a/bin/clean b/bin/clean index 4b3162c..25aabe5 100755 --- a/bin/clean +++ b/bin/clean @@ -64,6 +64,8 @@ journal_retention=2w quiet=() redirection=/dev/stdout +# @formatter:off +# TEMP: remove when https://github.com/lovesegfault/beautysh/issues/265 is fixed while :; do case "${1:-}" in -j | --journal) @@ -92,6 +94,7 @@ while :; do esac shift done +# @formatter:on uid=$(id -u) if [[ "${uid}" -ne 0 ]]; then diff --git a/bin/generate-moduli b/bin/generate-moduli index 4ba4bc0..bf651fe 100755 --- a/bin/generate-moduli +++ b/bin/generate-moduli @@ -16,8 +16,8 @@ ## @param $2 Output file path ######################################### _generate-DH-primes() { - local bit="${1?:Bit missing}" - local output_file="${2?:Output file name missing}" + local bit="${1:?Bit missing}" + local output_file="${2:?Output file name missing}" local candidates candidates=$(mktemp --tmpdir DH_candidates.XXXXXXXX) diff --git a/bin/pass-man b/bin/pass-man index 5a30894..f73159c 100755 --- a/bin/pass-man +++ b/bin/pass-man @@ -15,7 +15,7 @@ _usage() { cat </dev/null 2>&1 } diff --git a/lib/ssh.sh b/lib/ssh.sh index 2295c39..ee6f883 100644 --- a/lib/ssh.sh +++ b/lib/ssh.sh @@ -13,8 +13,8 @@ ## @default 12 hours ################################# unlock-key() { - local key="${1?:Path to SSH key missing}" - local pass_path="${2?:Path to password missing}" + local key="${1:?Path to SSH key missing}" + local pass_path="${2:?Path to password missing}" local cache_time="${3:-12h}" local password public_key current_identities @@ -74,8 +74,8 @@ ssh-tunnel-close() { ## @param $2 Local port ############################ socks5-tunnel-open() { - local remote="${1?:Remote missing}" - local port="${2?:Local port missing}" + local remote="${1:?Remote missing}" + local port="${2:?Local port missing}" ssh-tunnel-open -fqN -D "${port}" "${remote}" } @@ -85,8 +85,8 @@ socks5-tunnel-open() { ## @param $2 Local port ############################ socks5-tunnel-close() { - local remote="${1?:Remote missing}" - local port="${2?:Local port missing}" + local remote="${1:?Remote missing}" + local port="${2:?Local port missing}" ssh-tunnel-close -fqN -D "${port}" "${remote}" } @@ -96,8 +96,8 @@ socks5-tunnel-close() { ## @param $2 Comment for key ################################ ssh-create-key() { - local key_name="${1?:Key name missing}" - local comment="${2?:Key comment missing}" + local key_name="${1:?Key name missing}" + local comment="${2:?Key comment missing}" shift 2 ssh-keygen \ -t ed25519 \ @@ -117,12 +117,12 @@ ssh-create-key() { ## @param $6 Path to user public key - this will be signed ############################################################## ssh-sign-user() { - local validity="${1?:Validity interval missing}" - local ca_key_path="${2?:Path to CA key missing}" - local identity="${3?:Key identity missing}" - local principals="${4?:Principals missing}" - local serial="${5?:Serial number missing}" - local pubkey_path="${6?:User public key path missing}" + local validity="${1:?Validity interval missing}" + local ca_key_path="${2:?Path to CA key missing}" + local identity="${3:?Key identity missing}" + local principals="${4:?Principals missing}" + local serial="${5:?Serial number missing}" + local pubkey_path="${6:?User public key path missing}" shift 6 ssh-keygen \ -V "${validity}" \ @@ -138,7 +138,7 @@ ssh-sign-user() { ## @param $1 Path to certificate #################################### ssh-view-cert() { - local cert="${1?:Certificate path missing}" + local cert="${1:?Certificate path missing}" shift ssh-keygen -L -f "${cert}" "${@}" } diff --git a/lib/text.sh b/lib/text.sh index c12854f..5c0e11e 100644 --- a/lib/text.sh +++ b/lib/text.sh @@ -63,7 +63,7 @@ urlencode() { ## @param $1 String to decode ################################ urldecode() { - local encoded="${1:?"URL-encoded string missing"}" + local encoded="${1:?URL-encoded string missing}" # Change + to space encoded="${encoded//+/ }"