pentest-distro-builder/filesystem/root/.tmux/plugins/tmux-net-speed/scripts/download_speed.sh
Kaj Forney 4fdc60b6a2 Add autologin and custom tmux config.
Former-commit-id: 9f5a64d372
Former-commit-id: 89d8a1302bd2a72239fbe9ad9820be4ecda76cab
2018-09-27 17:40:01 -06:00

29 lines
582 B
Bash
Executable file

#!/bin/bash -
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
source "$CURRENT_DIR/helpers.sh"
sum_download_speed()
{
# Output uses first column
sum_speed 1
}
main()
{
# TODO make configurable
#local file=$(get_tmux_option $DOWNLOAD_FILE)
local file=$DOWNLOAD_FILE
local old_val=$(read_file $file)
local new_val=$(sum_download_speed)
write_file $file $new_val
local vel=$(get_velocity $new_val $old_val)
## Format output
local format=$(get_tmux_option @download_speed_format "%s")
printf "$format" "$vel"
}
main