Last active
August 11, 2022 02:25
-
-
Save mbierman/b0267303c15e0f2ac4018f21ee107dc4 to your computer and use it in GitHub Desktop.
Install iftop on Firewalla
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# v2.0 | |
# https://gist.github.com/mbierman/dd9fd1b89220af98dea74b2ab95a9f15 | |
# 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=iftop | |
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..." | |
export DEBIAN_FRONTEND=noninteractive | |
unalias apt | |
unalias apt-get | |
sudo apt-get update -yq | |
sudo apt-get install -yq $app | |
echo -e "$edate $app instaleld!" | tee -a $log | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment