Skip to content

Commit

Permalink
Updated Installer.sh
Browse files Browse the repository at this point in the history
  • Loading branch information
sundaysec authored Aug 20, 2018
1 parent 279e56e commit 77b233d
Showing 1 changed file with 79 additions and 1 deletion.
80 changes: 79 additions & 1 deletion src/installer.sh
Original file line number Diff line number Diff line change
@@ -1,3 +1,81 @@
echo 'Installer for Anubis'
#Installer for anubis
# First things first

# Declare variables
#"""Colors
red=`tput setaf 1`
green=`tput setaf 2`
normal=`tput sgr0`
#"""OS
os=`uname`
distribution=`awk '{print $1}' /etc/issue`
user=`whoami`

# Cool Banner
# Loving fancy things
cat << EOF
█████╗ ███╗ ██╗██╗ ██╗██████╗ ██╗███████╗
██╔══██╗████╗ ██║██║ ██║██╔══██╗██║██╔════╝
███████║██╔██╗ ██║██║ ██║██████╔╝██║███████╗
██╔══██║██║╚██╗██║██║ ██║██╔══██╗██║╚════██║
██║ ██║██║ ╚████║╚██████╔╝██████╔╝██║███████║
╚═╝ ╚═╝╚═╝ ╚═══╝ ╚═════╝ ╚═════╝ ╚═╝╚══════╝
Installer
EOF
echo "OS:${green}$os${normal} Distribution:${green}$distribution${normal} Logged in as:${green}$user${normal}"

#Request root access/sudo
function check() {
#$EUID = user id 0 is for root
if [[ "$EUID" -ne 0 ]]; then
echo "${red}[✘]Error!!! Not enough priviledged${normal}"
sleep 3
echo "${red}[✘]Requesting root${normal}"
#Running the installer with sudo
sudo ./installer.sh
# Prevent script from continue running
exit 1
fi
}


#Check for dependencies
if command -v python3 &>/dev/null; then
echo ""
echo "${green}[✔]Python3 installed${normal}"
echo ""
else
echo "${red}[✘]Python3 is not installed${normal}"
py3=False
fi

#Check internet connection
# Can also use ping http://www.msftncsi.com/ncsi.txt
wget -q --spider http://google.com

if [ $? -eq 0 ]; then
echo "[*]̾i̾n̾s̾t̾a̾l̾l̾i̾n̾g ̾d̾e̾p̾e̾n̾d̾e̾n̾c̾i̾e̾s"
# Installing argcomplete quietly
pip install argcomplete 2>&1 >/dev/null &
PID=$!
i=1
sp="/-\|"
echo -n ' '
while [ -d /proc/$PID ]
do
printf "\b${sp:i++%${#sp}:1}"
done
activate-global-python-argcomplete

#Install Python3
if py3=False; then
apt-get -q --assume-yes install python3 2>&1 >/dev/null
fi


else
echo "${red}[**]${normal}Error${red}[**]${normal}"
echo "Cannot complete Installation :("
echo "Please check your internet connection"
fi

0 comments on commit 77b233d

Please sign in to comment.