install.sh 1.6 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. #!/bin/bash
  2. sudo usermod -a -G spi,gpio pi
  3. sudo apt install build-essential python3-dev python3-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5 python3-bs4 -y
  4. sudo python3 -m pip install --upgrade luma.led_matrix
  5. pip3 install adafruit-circuitpython-max7219
  6. pip3 install requests
  7. cp scripts/* /home/$USER
  8. cd /home/pi/
  9. git clone http://192.168.1.8:3000/wareck/luma.led_matrix.git
  10. git clone http://192.168.1.8:3000/wareck/Bitcoin-Bar.git
  11. echo $MyUser>/tmp/tmp_user
  12. if ! grep "#Max7219 Clock" /etc/rc.local >/dev/null
  13. then
  14. sudo bash -c 'sed -i -e "s/exit 0//g" /etc/rc.local'
  15. sudo bash -c 'echo "#Max7219 Clock" >>/etc/rc.local'
  16. sudo bash -c 'echo -e "HN=\x24(hostname)">>/etc/rc.local'
  17. sudo bash -c 'echo -e "python3 /home/pi/view_message.py -t \x22\x24HN : \x24_IP \x24_IP\x22" >>/etc/rc.local'
  18. sudo bash -c 'echo "">>/etc/rc.local'
  19. sudo bash -c 'echo "python3 /home/pi/silly_clock.py &" >>/etc/rc.local'
  20. sudo bash -c 'echo "exit 0" >>/etc/rc.local'
  21. fi
  22. if ! grep "net.ipv6.conf.all.disable_ipv6=1" /etc/sysctl.conf >/dev/null
  23. then
  24. sudo cp /etc/sysctl.conf /tmp/sysctl.conf
  25. sudo chmod 777 /tmp/sysctl.conf
  26. sudo bash -c 'echo "net.ipv6.conf.all.disable_ipv6=1"' >> /tmp/sysctl.conf
  27. sudo bash -c 'echo "net.ipv6.conf.default.disable_ipv6=1"' >> /tmp/sysctl.conf
  28. sudo bash -c 'echo "net.ipv6.conf.lo.disable_ipv6=1"' >> /tmp/sysctl.conf
  29. sudo bash -c 'echo "net.ipv6.conf.eth0.disable_ipv6 = 1"' >> /tmp/sysctl.conf
  30. sudo chmod 644 /tmp/sysctl.conf
  31. sudo cp /tmp/sysctl.conf /etc/sysctl.conf
  32. sudo rm /tmp/sysctl.conf
  33. fi
  34. cd $PWD
  35. sudo python3 view_message.py --text "If you can read this, max7219 is working. You can reboot RaspberryPi."