Skip to content

Instantly share code, notes, and snippets.

@NullArray
Last active June 4, 2019 11:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NullArray/4c09669eacd3f93d3206b850d22419e1 to your computer and use it in GitHub Desktop.
Save NullArray/4c09669eacd3f93d3206b850d22419e1 to your computer and use it in GitHub Desktop.
#!/bin/bash
#____ ____ __
#\ \ / /____ _____/ |_ ___________
# \ Y // __ \_/ ___\ __\/ _ \_ __ \
# \ /\ ___/\ \___| | ( <_> ) | \/
# \___/ \___ >\___ >__| \____/|__|
# \/ \/
#--Licensed under GNU GPL 3
#----Authored by Vector/NullArray
##############################################
# I'm posting this shell script here so that
# I can grab the raw paste with the installer
# Whenever i need to.
# Coloring scheme for notfications
ESC="\x1b["
RESET=$ESC"39;49;00m"
CYAN=$ESC"33;36m"
RED=$ESC"31;01m"
GREEN=$ESC"32;01m"
# Warning
function warning(){
echo -e "$RED [!] $1 $RESET"
}
# Green notification
function notification(){
echo -e "$GREEN [+] $1 $RESET"
}
# Cyan notification
function notification_b(){
echo -e "$CYAN $1 $RESET\n"
}
# Function to check CPU architecture and install the proper version of Geckodriver
function get_gdriver() {
printf "\n\n"
MACHINE_TYPE=`uname -m`
if [[ ${MACHINE_TYPE} == 'x86_64' ]]; then
notification "x86_64 architecture detected..."
sleep 1
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux64.tar.gz
tar -xvf geckodriver-v0.24.0-linux64.tar.gz
rm geckodriver-v0.24.0-linux64.tar.gz
chmod +x geckodriver
mv geckodriver /usr/sbin
sudo ln -s /usr/sbin/geckodriver /usr/bin/geckodriver
notification "Geckodriver has been succesfully installed"
else
notification "x32 architecture detected..."
sleep 1
wget https://github.com/mozilla/geckodriver/releases/download/v0.24.0/geckodriver-v0.24.0-linux32.tar.gz
tar -xvf geckodriver-v0.24.0-linux32.tar.gz
rm geckodriver-v0.24.0-linux32.tar.gz
chmod +x geckodriver
mv geckodriver /usr/sbin
sudo ln -s /usr/sbin/geckodriver /usr/bin/geckodriver
notification "Geckodriver has been succesfully installed."
fi
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment