Skip to content

Commit

Permalink
Add Network Quality CLI Command (raycast#715)
Browse files Browse the repository at this point in the history
* Add Network Quality CLI

* Update network-quality.sh

* Update Script from PR Comments

* Update Author Name and URL

* Update Script Command to Inline
  • Loading branch information
LanikSJ authored Apr 18, 2022
1 parent 3c2588b commit 6d93847
Showing 1 changed file with 25 additions and 0 deletions.
25 changes: 25 additions & 0 deletions commands/system/network-quality.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 6d93847

Please sign in to comment.