shellcheck
This commit is contained in:
parent
8ebb5071a4
commit
96e65508d1
1 changed files with 4 additions and 4 deletions
|
|
@ -10,7 +10,7 @@ trap 'cleanup' ERR INT
|
|||
cleanup() {
|
||||
if [[ -n "$archive" ]]; then
|
||||
rm -f "${archive}"*
|
||||
log "INFO" "Cleaning up $(basename $archive) remains before exit"
|
||||
log "INFO" "Cleaning up $(basename "$archive") remains before exit"
|
||||
fi
|
||||
}
|
||||
|
||||
|
|
@ -55,7 +55,7 @@ set_volumes() {
|
|||
local volumes=""
|
||||
|
||||
if [[ -n "$size" ]]; then
|
||||
smart_size="$(calc_smart_volumes $input_file $size || echo -n)"
|
||||
smart_size="$(calc_smart_volumes "$input_file" "$size" || echo -n)"
|
||||
volumes="-v${smart_size}m"
|
||||
fi
|
||||
|
||||
|
|
@ -66,7 +66,7 @@ set_volumes() {
|
|||
|
||||
# Generates a random archive name of 20 alphanumeric characters
|
||||
generate_name() {
|
||||
archive="$archive_dir/$(tr -dc [:alnum:] < /dev/urandom | head -c 20).7z"
|
||||
archive="$archive_dir/$(tr -dc '[:alnum:]' < /dev/urandom | head -c 20).7z"
|
||||
|
||||
log "INFO" "Generated archive name '$archive'"
|
||||
|
||||
|
|
@ -100,7 +100,7 @@ main() {
|
|||
exit 1
|
||||
fi
|
||||
|
||||
volumes="$(set_volumes $input_file $size)"
|
||||
volumes="$(set_volumes "$input_file" "$size")"
|
||||
archive="$(generate_name)"
|
||||
|
||||
log "INFO" "Packing '${input_file}' into archive '$archive' with password '${archive_pwd}'"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue