Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Install Speedtest for firewalla
# 2.0
# Put this script in ~/.firewalla/config/post_main.d in order to resinstall after upgrades
if ! [ -w $log ] ; then
sudo touch $log
sudo chmod a+w $log
edate=$(date +'%a %b %d %H:%M:%S %Z %Y')
Cversion=$(curl | egrep -o '<a href="[0-9]{1,}\.)+([0-9]{1,}\.)+([0-9]{1,})+-linux-x86_64.tgz">x86_64</a>' | cut -f3 -d "-")
install () {
# unalias apt
# unalias apt-get
# sudo apt update
# sudo apt-get install curl
# curl -s | sudo bash
# sudo apt-get install speedtest
# sudo apt-get update -yq
# curl -s | sudo bash
# sudo apt-get install -yq $app
[ -f "$file" ] && sudo sudo && /etc/apt/sources.list.d/speedtest.list && rm $file
export DEBIAN_FRONTEND=noninteractive
curl${binary}.tgz --output /data/${binary}.tgz
gunzip /data/${binary}.tgz
tar -xvf /data/${binary}.tar
cd /data
rm ${binary}.tar speedtest.5 ${binary}.tar.z
echo -e "$edate $app instaleld!" | tee -a $log
if [ -x "/data/speedtest" ]; then
Iversion=$(/data/speedtest --version | grep Linux | sed -e 's|Speedtest by Ookla ||g' | cut -f1 -d" " | cut -f1-3 -d".")
if [ "$Iversion" = "$Cversion" ] ; then
echo -e "\n\n$app instaleld!\n bye"
echo "updating speedtest"
echo "$app wasn't installed "
echo "installing..."
Copy link

mbierman commented Mar 27, 2021

Want to have speedtest cli on Firewalla Gold? This will tell you how fast your internet connection is right on Firewalla (no wifi or Ethernet involved) see this for additional info on Firewalla installation.

see also this script if you want to run speedtest and log results.

Firewalla will remove anything installed after upgrades so you can install a script to reinstall for you after firewalla upgrades and possibly reboots.

Log in to firewalla with ssh. Then type:
cd ~/.firewalla/config/post_main.d/

if no directory is found

mkdir ~/.firewalla/config/post_main.d/
cd ~/.firewalla/config/post_main.d/

Then save this script and make it executable using vi or nano. For example
sudo vi

Copy/Paste this script at and save and close.

This should give you a file at ~/.firewalla/config/post_main.d/

Then change permissions and run it.

sudo chmod a+x

I adapted this to run on my Firewalla Gold because anything that gets installed may get wiped on reboot. So this checks if speedtest is installed and installs it if it isn’t found.

This will now run every time firewalla boots or upgrades. If speedtest isn’t found, it will be installed.

Then you can run speedtest.

speedtest --interface=eth0


speedtest --interface=eth1

if you have dual WAN and want to test WAN2

See also this script which will log your speedtests to a Google Sheet, a log file, or both.

Copy link

cstrat commented Mar 28, 2021


Copy link

cstrat commented Mar 29, 2021

Thanks for this script, I just installed it. Exactly what I needed, just hope they build it into the firewalla interface at some point 👍

Copy link

mbierman commented Mar 29, 2021

You’re welcome! Glad you found it useful.

Copy link

mbierman commented Aug 29, 2021

Copy link

chezdude2010 commented Aug 12, 2022

Michael - I made some edits to the gist to add in automatic architecture detection and some cleanup on the unpacking portion. Let me know if you are interested in the edits and I can see about uploading them to the gist.

Copy link

mbierman commented Aug 13, 2022

@chezdude2010 sure, great.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment