Skip to content

Instantly share code, notes, and snippets.

@mbierman
Last active August 11, 2022 02:24
Show Gist options
  • Save mbierman/362193a8cfaf14361945c27c48692d50 to your computer and use it in GitHub Desktop.
Save mbierman/362193a8cfaf14361945c27c48692d50 to your computer and use it in GitHub Desktop.
install sshpass. on Firewalla
#!/bin/bash
# v 2.0
# https://gist.github.com/mbierman/362193a8cfaf14361945c27c48692d50
# Put this script in ~/.firewalla/config/post_main.d in order to resinstall after upgrades
log=/data/fw_reboot.txt
app=sshpass
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment