diff options
| author | Deposite Pirate | 2025-10-13 12:57:43 +0200 |
|---|---|---|
| committer | Deposite Pirate | 2025-10-13 12:57:43 +0200 |
| commit | 0350bbf2d0815cfcd3daa0bdc4dcb814f6663ac8 (patch) | |
| tree | 07d41386a52eeaa33a27d2d1af173c4b5946a6f4 | |
| parent | edb2c48ea2771bcaf12ece567ad3d2937821840f (diff) | |
Remove test-net.
It only works on Linux. So this is hardly a good place for it.
deleted: functions/test-net.fish
| -rw-r--r-- | functions/test-net.fish | 58 |
1 files changed, 0 insertions, 58 deletions
diff --git a/functions/test-net.fish b/functions/test-net.fish deleted file mode 100644 index 93b60aa..0000000 --- a/functions/test-net.fish +++ /dev/null @@ -1,58 +0,0 @@ -function test-net --description 'Test network connectivity' - -if not command -q 'ip' - echo "Can't find ip." - return 1 -end - -if not command -q 'ping' - echo "Can't find ping." - return 1 -end - -if not command -q 'curl' - echo "Can't find curl." - return 1 -end - -set -l extipurl 'https://ifconfig.io' - -function print_header -a headertext - echo - set_color blue - echo $headertext - set_color normal - echo -end - -function print_ip -a label -a ip - echo -n $label - set_color yellow - echo $ip - set_color normal -end - -function ping_host -a host - echo - set_color green - ping -q -O -c 1 $host - set_color normal -end - -print_header "Testing local connectivity" - -set -l gateway "$(ip -c=never -o route show | awk '/default via/ {print $3}')" - -print_ip 'Gateway: ' "$gateway" -ping_host "$gateway" - -print_header "Testing internet connectivity" - -print_ip 'External IPv4 address: ' "$(curl -s -4 $extipurl)" -print_ip 'External IPv6 address: ' "$(curl -s -6 $extipurl)" - -ping_host 8.8.8.8 - -echo - -end |
