wareck il y a 3 ans
Parent
commit
eb42c306e7
2 fichiers modifiés avec 30 ajouts et 0 suppressions
  1. 30 0
      install.sh
  2. 0 0
      scripts/silly_clock.py

+ 30 - 0
install.sh

@@ -1,12 +1,42 @@
 #!/bin/bash
+
 sudo usermod -a -G spi,gpio pi
 sudo apt install build-essential python3-dev python3-pip libfreetype6-dev libjpeg-dev libopenjp2-7 libtiff5 python3-bs4
 sudo python3 -m pip install --upgrade luma.led_matrix
 pip3 install adafruit-circuitpython-max7219
 pip3 install requests
+cp scripts/* /home/$USER
 
 cd /home/pi/
 git clone http://gogserver.dnsalias.com:3000/wareck/luma.led_matrix.git
 git clone http://gogserver.dnsalias.com:3000/wareck/Bitcoin-Bar.git
+
+echo $MyUser>/tmp/tmp_user
+if ! grep "#Max7219 Clock" /etc/rc.local >/dev/null
+then
+sudo bash -c 'sed -i -e "s/exit 0//g" /etc/rc.local'
+sudo bash -c 'echo "#Max7219 Clock" >>/etc/rc.local'
+sudo bash -c 'echo -e "HN=\x24(hostname)">>/etc/rc.local'
+sudo bash -c 'echo -e "python3 /home/pi/view_message.py -t \x22\x24HN:\x24_IP   \x24_IP\x22" >>/etc/rc.local'
+sudo bash -c 'echo "">>/etc/rc.local'
+sudo bash -c 'echo "python3 /home/pi/silly_clock.py &" >>/etc/rc.local'
+sudo bash -c 'echo "exit 0" >>/etc/rc.local'
+fi
+if ! grep "net.ipv6.conf.all.disable_ipv6=1" /etc/sysctl.conf >/dev/null
+then
+sudo cp /etc/sysctl.conf /tmp/sysctl.conf
+sudo chmod 777 /tmp/sysctl.conf
+sudo bash -c 'echo "net.ipv6.conf.all.disable_ipv6=1"' >> /tmp/sysctl.conf
+sudo bash -c 'echo "net.ipv6.conf.default.disable_ipv6=1"' >> /tmp/sysctl.conf
+sudo bash -c 'echo "net.ipv6.conf.lo.disable_ipv6=1"' >> /tmp/sysctl.conf
+sudo bash -c 'echo "net.ipv6.conf.eth0.disable_ipv6 = 1"' >> /tmp/sysctl.conf
+sudo chmod 644 /tmp/sysctl.conf
+sudo cp /tmp/sysctl.conf /etc/sysctl.conf
+sudo rm /tmp/sysctl.conf
+fi
+
+
 cd $PWD
+sudo python3 view_message.py --text "If you can read this, max7219 is working. You can reboot RaspberryPi."
+
 

+ 0 - 0
scripts/silly_clock.py