Skip to content

Commit

Permalink
Add Unix installer.
Browse files Browse the repository at this point in the history
  • Loading branch information
diegomacario committed Jan 7, 2017
1 parent e7b1ff9 commit 470a56d
Showing 1 changed file with 32 additions and 0 deletions.
32 changes: 32 additions & 0 deletions installer/unix_installer.sh
Original file line number Diff line number Diff line change
@@ -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"

0 comments on commit 470a56d

Please sign in to comment.