Skip to content

Instantly share code, notes, and snippets.

@JuniorPolegato
Created April 3, 2018 12:00
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 JuniorPolegato/dbc21a13a9ce8b56e965f4bdbd00f48c to your computer and use it in GitHub Desktop.
Save JuniorPolegato/dbc21a13a9ce8b56e965f4bdbd00f48c to your computer and use it in GitHub Desktop.
Rodar o warsaw no Debian Buster dentro de uma jaula com Stretch e já abrir o site do Banco do Brasil
# Criar a jaula
mkdir stretch
debootstrap stretch stretch # se tiver apt-cache ou mirror coloque aqui
# Preparar para montar as partições do sistema dentro da jaula
mount |
sed 's/\(.*\) on \(.*\) type \(.*\) .*/mkdir -p \2; mount -t \3 \1 \2/' |
grep -v /dev/sd >> stretch/root/.bashrc
# Entrar na jaula
chroot stretch
# Configurações iniciais e instalação de pacotes necessários
sed -i 's/main/main contrib non-free/' /etc/apt/sources.list
apt-get update
apt-get install locales
sed -i 's/# \(pt_BR\|pt_PT\|en_US\)\.UTF-8/\1.UTF-8/' /etc/locale.gen
locale-gen
apt-get update
apt-get install firefox-esr-l10n-pt-br libnss3-tools libcurl3 psmisc
# Criar usuário comum e configurar para iniciar o warsaw e login no BB
adduser junior
env|grep LANG|sed 's/^/export /' >> /home/junior/.bashrc
echo '/usr/local/bin/warsaw/core' >> /home/junior/.bashrc
echo 'firefox https://www2.bancobrasil.com.br/aapf/login.jsp' >> /home/junior/.bashrc
echo 'exit' >> /home/junior/.bashrc
# Rodar firefox antes de instalar o warsaw para criar estrutura ~/.mozilla
su - junior
# Baixar e instalar o warsaw
#wget https://cloud.gastecnologia.com.br/cef/warsaw/install/GBPCEFwr32.deb
#dpkg -i GBPCEFwr32.deb
wget https://cloud.gastecnologia.com.br/gas/diagnostico/warsaw_setup_32.deb
dpkg -i warsaw_setup_32.deb
# Rodar o warsaw como usuário e abrir o firefox já na página de login do BB
su - junior
# Automatizar a jaula para iniciar o warsaw e o firefox no login do BB
echo '/etc/init.d/warsaw stop' >> /root/.bashrc
echo 'killall core wsatspi' >> /root/.bashrc
echo '/etc/init.d/warsaw start' >> /root/.bashrc
echo 'su - junior' >> /root/.bashrc
echo '/etc/init.d/warsaw stop' >> /root/.bashrc
echo 'killall core wsatspi' >> /root/.bashrc
echo 'umount `mount|cut -d " " -f 3|sort -r`' >> /root/.bashrc
echo 'exit' >> /root/.bashrc
exit
# Próximas vezes é só entrar na jaula que já abre o navegador no login do BB
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment