mirror of
https://github.com/kforney/pentest-distro-builder.git
synced 2024-11-28 19:25:25 -07:00
Kaj Forney
4fdc60b6a2
Former-commit-id: 9f5a64d372
Former-commit-id: 89d8a1302bd2a72239fbe9ad9820be4ecda76cab
28 lines
579 B
Bash
Executable file
28 lines
579 B
Bash
Executable file
#!/bin/bash -
|
|
|
|
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
source "$CURRENT_DIR/helpers.sh"
|
|
|
|
sum_upload_speed()
|
|
{
|
|
# Output uses ninth column
|
|
sum_speed 9
|
|
}
|
|
|
|
main()
|
|
{
|
|
# TODO make configurable
|
|
#local upload_file=$(get_tmux_option $UPLOAD_FILE)
|
|
local file=$UPLOAD_FILE
|
|
local old_val=$(read_file $file)
|
|
local new_val=$(sum_upload_speed)
|
|
|
|
write_file $file $new_val
|
|
local vel=$(get_velocity $new_val $old_val)
|
|
|
|
## Format output
|
|
local format=$(get_tmux_option @upload_speed_format "%s")
|
|
printf "$format" "$vel"
|
|
}
|
|
main
|
|
|