|
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758 |
- #!/bin/bash
- # Allo-GG
- # Installation de Allo-GG sur un Pi Zero avec Rasbian.
-
- # Configuration du nom réseau du module
- echo "allo-gg" > /etc/hostname
-
- # Installation des dependances
- cd
- apt-get -y update
- apt-get -y upgrade
- apt-get -y install apache2 php7.0 git-core vim tree
-
- # Installation de wiringPi
- git clone git://git.drogon.net/wiringPi
- cd wiringPi
- git pull origin
- ./build
- cd
-
- # Création de l'utilisateur
- useradd --create-home allo-gg
- adduser allo-gg sudo
- echo allo-gg:allo-gg | chpasswd
- echo root:allo-gg | chpasswd
-
- # Autoriser le reboot du module
- echo >> /etc/sudoers
- echo "## user is allowed to execute halt and reboot" >> /etc/sudoers
- echo "allo-gg ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff" >> /etc/sudoers
- echo "www-data ALL=NOPASSWD: /sbin/halt, /sbin/reboot, /sbin/poweroff" >> /etc/sudoers
-
- # Autorisation de clefs SSH publiques
- echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDbvr8J95SXj0byVhBSOt/iShxzf0TVGKaxvo4d+pdrEaiDFxQEn/Iim9qEH9FXV9kQ8frUuYmVbh7Rqvh8QpTQM77eLHeZgXejw7St0OMmZSGpUsomIANZQNspDQ/qQbXFXmKnGJiC7TCEqaNoDTmHrdZ4Hvei4ly16e8Zic5pjcMruNeixcVkZOLJZWViGgbMlZN8jSll9pFfNRYKhIp6boalK5DexzgUZkUCk4HkPHo0I70LyElINmt9PkpHwzAFbsTRmI27Z9C5xI5OZ86aL+Kq4lm+MoD+f3hDiOdAByNqIEU1LU7tnMpQHbKSYSoVHlySF1+tuw3O1E4HQO45 heuzef@x240" >> /home/allo-gg/.ssh/authorized_keys
- echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDkdi/Nt+Remfwx5vM/lBmnTUOQ3+UJtbT4P1P+sOXt0dADUHj7gRvZxfb73n7A8y6rfocDiV4IRf1yvg8JWrAFC7/aDCMYDAOMAld9fKFU7u73beWl0zMSTVSGxt2MTSpyU+POx6VvucWppJQJN8R2VtAPHheUZlpLEf0n2gzgyYEYuHEOPHfx91u3omu4QCYRVWv4ZFRCCvznC2Cd+GW2S8uNqe6oxe2HuXtghAIRO+XXDSfwJc0lsm7uKMJ9rtQMYSYUI0f3HErHArf5ssQMCMcHivdJuoWEmvK2UarQdT5kKlytDUjFMrjj4Ks6+Ew6mdvp6H4/PeRjONaDWOQ3 karimcisse@Karims-MacBook-Air.local" >> /home/allo-gg/.ssh/authorized_keys
-
- # Désactiver toutes authentifications SSH par mot de passe
- echo "PasswordAuthentication no" >> /etc/ssh/sshd_config
- echo "PermitRootLogin no" >> /etc/ssh/sshd_config
-
- # Installation de Allo-GG
- rm -vf /var/www/html/index.html
- chown -R allo-gg:allo-gg /var/www/html/
- su -l allo-gg -c "git clone https://github.com/heuzef/Allo-GG.git /var/www/html/"
-
- # Lancement automatique du script de demarrage
- sed -i '1 i #!/bin/sh -e' /etc/rc.local
- sed -i '$ d' /etc/rc.local
- echo "/bin/bash /var/www/html/scripts/boot.sh &" >> /etc/rc.local
- echo "" >> /etc/rc.local
- echo "exit 0" >> /etc/rc.local
-
- echo
- echo "----------------------------"
- echo "Install done ! Rebooting ..."
- sleep 3
-
- sh /var/www/html/scripts/reboot.sh
|