Skip to content

Instantly share code, notes, and snippets.

@mbierman
Last active June 16, 2024 06:02
Show Gist options
  • Save mbierman/bc6b9f11c82f6fd7efdafac269fb058d to your computer and use it in GitHub Desktop.
Save mbierman/bc6b9f11c82f6fd7efdafac269fb058d to your computer and use it in GitHub Desktop.
install sensors on Firewalla
#!/bin/bash
# v 2.0
# https://gist.github.com/mbierman/bc6b9f11c82f6fd7efdafac269fb058d
# Put this script in ~/.firewalla/config/post_main.d in order to resinstall after upgrades
log=/data/fw_reboot.txt
if ! [ -w $log ] ; then
sudo touch $log
sudo chmod a+w $log
fi
app=sensors
edate=$(date +'%a %b %d %H:%M:%S %Z %Y')
command_exists () {
command -v $1 >/dev/null 2>&1;
}
if command_exists $app; then
echo -e "\n\n$app instaleld!\n bye"
exit
else
echo "$app could not be found"
echo "installing..."
unalias apt
unalias apt-get
export DEBIAN_FRONTEND=noninteractive
sudo apt-get -yq update
sudo apt-get install -yq lm-$app
echo -e "$edate $app instaleld!" | tee -a $log
fi
@mbierman
Copy link
Author

mbierman commented May 20, 2022

Want to get easy access to temperature information on on Firewalla via the terminal or for scripting? This is what you need.

Installation & Persistance

Firewalla may remove anything installed after upgrades, so you can install a script to reinstall for you after firewalla upgrades and possibly some 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 m_sensors.sh

Copy/Paste this script at https://gist.github.com/mbierman/bc6b9f11c82f6fd7efdafac269fb058d and save and close.

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

Then change permissions and run it.

sudo chmod a+x install_speedtest.sh
~/.firewalla/config/post_main.d/m_sensors.sh

# now try it out: 

sensors -f
pi@firewalla:/data (Gold) $ sensors -f 
acpitz-virtual-0
Adapter: Virtual device
temp1:       +114.8°F  (crit = +260.6°F)
temp2:        +80.2°F  (crit = +203.0°F)

coretemp-isa-0000
Adapter: ISA adapter
Core 0:      +127.4°F  (high = +194.0°F, crit = +194.0°F)
Core 1:      +127.4°F  (high = +194.0°F, crit = +194.0°F)
Core 2:      +127.4°F  (high = +194.0°F, crit = +194.0°F)
Core 3:      +134.6°F  (high = +194.0°F, crit = +194.0°F)

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