From 470a56d77b1ac26de96da7d6acf0e79a3cd1ae32 Mon Sep 17 00:00:00 2001 From: diegomacario Date: Fri, 6 Jan 2017 20:54:29 -0500 Subject: [PATCH] Add Unix installer. --- installer/unix_installer.sh | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 installer/unix_installer.sh diff --git a/installer/unix_installer.sh b/installer/unix_installer.sh new file mode 100644 index 0000000..e5fcc24 --- /dev/null +++ b/installer/unix_installer.sh @@ -0,0 +1,32 @@ +#!/bin/bash + +set -e +script_runner=$(whoami) +exec_path="/usr/local/bin/" +exec_name="pfox" +exec_full_path="${exec_path}${exec_name}" +binary_download_url="https://github.com/diegomacario/PoorFox2/releases/download/1/pfox" + +control_c() +{ + echo -en "\n\n*** Exiting ***\n\n" + exit 1 +} + +trap control_c SIGINT + +echo -e "\n" +echo "############################" +echo "#### Poor Fox Installer ####" +echo "############################" + +# check if user is root +if [ $script_runner != "root" ] ; then + echo -e "\nError: You must execute this script as a normal user with sudo privileges.\n" + exit 1 +fi + +echo -e "\nThis script will simply download the binary for Poor Fox and place it under $exec_path\n" +curl -L $binary_download_url -o $exec_name && sudo mv $exec_name $exec_path && chmod +x $exec_full_path + +echo -e "\nSuccessfully installed Poor Fox.\n"