---
updatedAt: 2025-08-14T17:28:34.000Z
agentTools:
  siteIndex: https://developer.n-able.com/llms.txt
  projectIndex: https://developer.n-able.com/n-sight/llms.txt
---

# Mac - Remote Worker Speed Test

```shell Shell Script
#!/bin/bash

# ----- Legal: ----
# Sample scripts are not supported under any N-able support program or service.
# The sample scripts are provided AS IS without warranty of any kind.
# N-able expressly disclaims all implied warranties including, warranties
# of merchantability or of fitness for a particular purpose.
# In no event shall N-able or any other party be liable for damages arising
# out of the use of or inability to use the sample scripts.
# -----------------------------------------------------------



if [ "$1" ]
then
	minimumspeed="$1"
else
	minimumspeed=5120		# default minimum ~5 megabits.
fi


# Runs a speed test via fast.com API. Takes one parameter of kilobytes per second. 
# If bandwidth reports less than that minimum, the check fails.

tempFile="/tmp/speedcheck.txt"
token=$(curl -s https://fast.com/app-ed402d.js | grep -E -om1 'token:"[^"]+' | cut -f2 -d'"')

url=$(curl -s "https://api.fast.com/netflix/speedtest?https=true&token=$token&urlCount=1" | grep -E -o 'https[^"]+')

testURL=${url/speedtest/speedtest\/range\/0-10000}; 

if curl -H 'Referer: https://fast.com/' -H 'Origin: https://fast.com' "$testURL" -o /dev/null 2>&1 | tr -u '\r' '\n' > $tempFile
then
	averageDL=$(grep -E '^100' "$tempFile" | tr -u -s "[:space:]" | cut -d ' ' -f7)
	echo "Speed reported: $averageDL K/s"
	
	if [ "$averageDL" -lt "$minimumspeed" ]
	then
		echo "[WARNING] Bandwidth detected less than minimum $minimumspeed K/s"
		exit 1001
	else
#		echo "Bandwidth sufficient."
		exit 0
	fi
				
else
	echo "[ERROR] Unable to reach fast.com"
	exit 1002
fi
```

```json Response Example
{"success":true}
```

# SCRIPT