#Upar no diretório www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial
#!/bin/bash
mkdir /lt38c
mkdir /lt38c/2015_2s_serial/
mkdir /lt38c/2015_2s_serial/arquivos.sys
mkdir /lt38c/2015_2s_serial/exe
mkdir /lt38c/2015_2s_serial/fontes.c
mkdir /lt38c/2015_2s_serial/history
mkdir /lt38c/2015_2s_serial/maff_mht
mkdir /lt38c/2015_2s_serial/mysql.sql
mkdir /lt38c/2015_2s_serial/pacotes
mkdir /lt38c/2015_2s_serial/site
mkdir /lt38c/2015_2s_serial/videos

#instalando mcedit e etc
/usr/bin/apt-get update
/usr/bin/apt-get install mc wput zip unzip ssh ntpdate -y

#instalacao bcm2835
cd /tmp
wget www.lt38c.hturbo.com/bcm2835-1.43.tar.gz -O /tmp/bcm2835.tar.gz
tar -zxvf bcm2835.tar.gz
cd bcm2835-1.43
./configure
make
sudo make check
sudo make install

#Instalando arduino IDE e link na porta serial
sudo apt-get install arduino -y
cd /tmp
wget http://project-downloads.drogon.net/gertboard/avrdude_5.10-4_armhf.deb
sudo dpkg -i avrdude_5.10-4_armhf.deb
chmod 4755 /usr/bin/avrdude
cd /tmp
wget http://project-downloads.drogon.net/gertboard/setup.sh
chmod +x setup.sh
./setup.sh

cd /tmp
wget http://project-downloads.drogon.net/gertboard/boards.txt
wget http://project-downloads.drogon.net/gertboard/programmers.txt
cd /usr/share/arduino/hardware/arduino
sudo mv boards.txt board.txt.bak -y
sudo mv /tmp/boards.txt -y
sudo mv programmers.txt programmers.txt.bak -y
sudo mv /tmp/programmers.txt -y

sudo ln /dev/ttyAMA0 /dev/ttyS1 -y

#baixando os arquivos do projeto
cd /tmp
wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/config.txt -O /tmp/config.txt
chmod 755 /tmp/config.txt
chown root:root /tmp/config.txt
cp /tmp/config.txt /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/config.txt /boot

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/keyboard -O /tmp/keyboard
chmod 644 /tmp/keyboard
chown root:root /tmp/keyboard
cp /tmp/keyboard /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/keyboard /etc/default

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/.bashrc -O /tmp/.bashrc
chmod 644 /tmp/.bashrc
chown root:root /tmp/.bashrc
cp /tmp/.bashrc /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/.bashrc /root

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/locale -O /tmp/locale
chmod 644 /tmp/locale
chown root:root /tmp/locale
cp /tmp/locale /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/locale /etc/default

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/profile -O /tmp/profile
chmod 644 /tmp/profile
chown root:root /tmp/profile
cp /tmp/profile /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/profile /etc

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/inittab -O /tmp/inittab
chmod 644 /tmp/inittab
chown root:root /tmp/inittab
cp /tmp/inittab /lt38c/2015_1s_servo_socket/arquivos.sys
cp /tmp/inittab /etc


wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/rc.local -O /tmp/rc.local
chmod 755 /tmp/rc.local
chown root:root /tmp/rc.local
cp /tmp/rc.local /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/rc.local /etc/init.d

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/sls.sh -O /tmp/sls.sh
chmod 700 /tmp/sls.sh
chown root:root /tmp/sls.sh
cp /tmp/sls.sh /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/sls.sh /root

wget www.lt38c.hturbo.com/Projetos/tmp/2015_2s_serial/arquivos.sys/timezone -O /tmp/timezone
chmod 644 /tmp/timezone
chown root:root /tmp/timezone
cp /tmp/timezone /lt38c/2015_2s_serial/arquivos.sys
cp /tmp/timezone /etc