Last active
May 9, 2022 13:57
-
-
Save marcelocmenezes/239a15229e2326dce88b5934b6a0419e to your computer and use it in GitHub Desktop.
Pré-setup Whatsapp não oficial
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
print_status() { | |
echo | |
echo "## $1" | |
echo | |
} | |
bail() { | |
echo 'Error executing command, exiting' | |
exit 1 | |
} | |
exec_cmd_nobail() { | |
echo "+ $1" | |
bash -c "$1" | |
} | |
exec_cmd() { | |
exec_cmd_nobail "$1" || bail | |
} | |
print_status 'Atualizando repos' | |
exec_cmd_nobail 'apt update' | |
print_status 'Instalando Software Properties Common' | |
exec_cmd_nobail 'apt install -y software-properties-common' | |
print_status 'Adicionando repo Universe' | |
exec_cmd_nobail 'apt-add-repository universe' | |
print_status 'Atualizando repos' | |
exec_cmd_nobail 'apt update' | |
print_status 'Instalando python2' | |
exec_cmd_nobail 'apt install -y python2-minimal' | |
print_status 'Configurando update-alternatives para o python' | |
exec_cmd_nobail 'update-alternatives --install /usr/bin/python python /usr/bin/python2 1' | |
exec_cmd_nobail 'update-alternatives --install /usr/bin/python python /usr/bin/python3 2' | |
print_status 'Configurando o python default' | |
exec_cmd_nobail 'update-alternatives --config python' | |
print_status 'Baixando o pip' | |
exec_cmd_nobail 'curl https://bootstrap.pypa.io/pip/2.7/get-pip.py --output get-pip.py' | |
print_status 'Instalando o pip' | |
exec_cmd_nobail 'python2 get-pip.py' | |
print_status 'Configurando o repo do NodeJS' | |
exec_cmd_nobail 'curl -sL https://deb.nodesource.com/setup_14.x -o nodesource_setup.sh' | |
exec_cmd_nobail 'nodesource_setup.sh' | |
print_status 'Instalando NodeJS' | |
exec_cmd_nobail 'apt install -y nodejs' | |
exec_cmd_nobail 'apt install -y npm' | |
print_status 'Instalando Firefox' | |
exec_cmd_nobail 'apt install -y firefox' | |
print_status 'Instalando Gecko Driver' | |
exec_cmd_nobail 'wget https://github.com/mozilla/geckodriver/releases/download/v0.31.0/geckodriver-v0.31.0-linux64.tar.gz' | |
exec_cmd_nobail 'tar -xvzf geckodriver*' | |
exec_cmd_nobail 'chmod +x geckodriver' | |
exec_cmd_nobail 'mv geckodriver /usr/local/bin/' | |
exec_cmd_nobail 'firefox --version' | |
exec_cmd_nobail 'node --version' | |
exec_cmd_nobail 'python --version' | |
print_status 'Fim do script' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment