style: shellcheck fixes

This commit is contained in:
Abhishek Keshri 2023-03-29 14:52:27 +05:30
parent 54ecf3dc0b
commit de0e8225a6
No known key found for this signature in database
GPG key ID: 62BD6AA2E913B3D3
10 changed files with 356 additions and 389 deletions

View file

@ -10,25 +10,25 @@ current_dir="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
source "$current_dir"/utils.sh
ping_function() {
case $(uname -s) in
Linux | Darwin)
# storing the hostname/IP in the variable PINGSERVER, default is google.com
pingserver=$(get_tmux_option "@tmux2k-ping-server" "google.com")
pingtime=$(ping -c 1 "$pingserver" | tail -1 | awk '{print $4}' | cut -d '/' -f 2)
echo "$pingtime ms"
;;
case $(uname -s) in
Linux | Darwin)
# storing the hostname/IP in the variable PINGSERVER, default is google.com
pingserver=$(get_tmux_option "@tmux2k-ping-server" "google.com")
pingtime=$(ping -c 1 "$pingserver" | tail -1 | awk '{print $4}' | cut -d '/' -f 2)
echo "$pingtime ms"
;;
CYGWIN* | MINGW32* | MSYS* | MINGW*)
# TODO - windows compatability
;;
esac
CYGWIN* | MINGW32* | MSYS* | MINGW*)
# TODO - windows compatability
;;
esac
}
main() {
echo "$(ping_function)"
RATE=$(get_tmux_option "@tmux2k-ping-rate" 5)
sleep "$RATE"
echo "$(ping_function)"
RATE=$(get_tmux_option "@tmux2k-ping-rate" 5)
sleep "$RATE"
}
# run main driver