Installez rapidement un Serveur Web, git, des librairies python, WiringPi, nodejs et Node-RED pour votre Raspberry Pi. Pratique et utile quand vous venez d'installer Raspbian.
Last active
March 25, 2018 08:03
Star
You must be signed in to star a gist
Installez un Webserver, Git, WiringPi, NodeJS et les Librairies Python pour votre Raspberry Pi
This file contains 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 | |
function pause { | |
echo "Appuyez sur ENTER pour continuer" | |
read | |
} | |
# Mise à jour des listes` | |
echo "Avant d'installer on va mettre à jours nos listes..." | |
sudo apt-get update | |
rep=1 | |
while [ "$rep" -eq 1 ]; do | |
clear | |
printf "Menu d'installation :\n\n" | |
echo "1. Installez un Webserver" | |
echo "2. Installez GIT" | |
echo "3. Installez la librairie python GPIO" | |
echo "4. Installez la librairie WiringPi" | |
echo "5. Ajoutez NodeJS et Node-RED" | |
echo -e "q. Quitter\n" | |
echo "Retrouver pleins d'astuce sur notre site web : http://creativpi.fr" | |
echo "Entrez un numéro pour lancer l'installation ou tapez q pour quitter." | |
read -r choix | |
case "$choix" in | |
1) | |
#Apache | |
echo "Installation d'Apache" | |
sudo apt-get install apache2 -y | |
cd /var/www/html/ | |
#php | |
echo "Installationd de PHP7" | |
sudo apt-get apt-get install php7.0 php7.0-curl php7.0-gd php7.0-imap php7.0-json php7.0-mcrypt php7.0-opcache php7.0-xmlrpc libapache2-mod-php7.0 -y | |
mv index.html index.php | |
touch index.php | |
sudo /etc/init.d/apache2 reload | |
#mySQL | |
echo "Installation de mySQL - Un mot de passe va être demandé" | |
sudo apt-get install mysql-server php-mysql -y | |
sudo service apache2 restart | |
echo "Vous pouvez vérifier l'installation d'Apache à cette adresse : http://localhost/" | |
pause ;; | |
2) | |
#Git | |
sudo apt-get install git-core | |
git --version | |
echo "Installation de Git réussi !" | |
pause ;; | |
3) | |
echo "Installation de la librairie python-dev python-gpio python-serial python-smbus python-picamera" | |
sudo apt-get install python-dev python-rpi.gpio python-serial python-picamera | |
pause ;; | |
4) | |
# On change de dossier | |
cd /home/pi/ | |
# WiringPi | |
echo "Installation de la lib WiringPi" | |
git clone git://git.drogon.net/wiringPi | |
cd wiringpi/ | |
git pull origin | |
./build | |
gpio -v | |
echo "Tous les ports GPIO" | |
gpio readall | |
pause ;; | |
5) | |
echo "Installation de NodeJS et NodeRED" | |
wget http://node-arm.herokuapp.com/node_latest_armhf.deb | |
sudo dpkg -i node_latest_armhf.deb | |
node -v | |
sudo apt-get install nodered | |
pause ;; | |
q) | |
echo "Consultez notre site web : http://creativpi.fr, Au revoir" | |
pause | |
rep=0 ;; | |
*) | |
pause ;; | |
esac | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment