minor change + shellcheck

This commit is contained in:
sometimesuseful 2024-11-12 17:09:39 +00:00
parent 006ecbe7d4
commit 2ec3e333e5

View file

@ -65,9 +65,10 @@ set_volumes() {
echo "$volumes"
}
# Generates a random archive name of 20 alphanumeric characters
generate_name() {
local archive_name="$archive_dir/$(tr -dc '[:alnum:]' < /dev/urandom | head -c 20).7z"
# Generates a random archive name of 20 alphanumeric characters
local archive_name
archive_name="$archive_dir/$(tr -dc '[:alnum:]' < /dev/urandom | head -c 20).7z"
log "INFO" "Generated archive name '$archive_name'"
@ -107,6 +108,7 @@ main() {
trap 'cleanup "$archive_name"' ERR INT
log "INFO" "Packing '${input_file}' into archive '$archive_name' with password '${password}'"
create_archive \
"$input_file" \
"$password" \