From 6d93847353e9433dee8b5938597bbc1dcbfe81c4 Mon Sep 17 00:00:00 2001 From: LanikSJ Date: Mon, 18 Apr 2022 08:53:46 -0700 Subject: [PATCH] Add Network Quality CLI Command (#715) * Add Network Quality CLI * Update network-quality.sh * Update Script from PR Comments * Update Author Name and URL * Update Script Command to Inline --- commands/system/network-quality.sh | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100755 commands/system/network-quality.sh diff --git a/commands/system/network-quality.sh b/commands/system/network-quality.sh new file mode 100755 index 000000000..607f6d0f9 --- /dev/null +++ b/commands/system/network-quality.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Required parameters: +# @raycast.schemaVersion 1 +# @raycast.title Network Quality +# @raycast.mode inline +# @raycast.refreshTime 20m + +# Optional parameters: +# @raycast.icon 🌐 + +# Documentation: +# @raycast.packageName System +# @raycast.author Archie Lacoin +# @raycast.authorURL https://github.com/pomdtr +# @raycast.author LanikSJ +# @raycast.authorURL https://github.com/LanikSJ + +result=$(networkQuality -v) + +rtt=$(echo "$result" | grep RTT | awk -F": " '{print $2}') +mbps_down=$(echo "$result" | grep "Download capacity" | awk -F": " '{print $2}') +mbps_up=$(echo "$result" | grep "Upload capacity" | awk -F": " '{print $2}') + +echo "↓ ${mbps_down} ↑ ${mbps_up} ↔ ${rtt} ms"