Skip to content

Instantly share code, notes, and snippets.

@mbierman
Last active August 11, 2022 02:23
Show Gist options
  • Save mbierman/561643e89e98137ea5f11f02a0f3ccd2 to your computer and use it in GitHub Desktop.
Save mbierman/561643e89e98137ea5f11f02a0f3ccd2 to your computer and use it in GitHub Desktop.
Install htop on Firewalla
#!/bin/bash
# 2.1
# https://gist.github.com/mbierman/561643e89e98137ea5f11f02a0f3ccd2
# 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=htop
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 update -yq
sudo apt-get install -yq $app
echo -e "$edate $app instaleld!" | tee -a $log
fi
@mbierman
Copy link
Author

mbierman commented Feb 5, 2022

Want to have speedtest htop on Firewalla Gold? See this for additional info on Firewalla installation.

Firewalla may 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 install_htop.sh

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

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

Then change permissions and run it.

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

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

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