1234567891011121314151617181920212223242526272829303132333435363738394041424344454647 |
- #!/bin/bash
- set -e
- Version=1.0
- ##Configuration:##
- RPI3=YES # YES/NO
- SERIAL=YES #YES for serial (attiny), NO for USB (teensy/arduino)
- echo -e "Serial Minecraft LedStatus installer $Version:"
- echo
- echo -e "Install dependencies, libraries and tools :"
- if ! [ -x "$(command -v pip)" ]
- then
- sudo apt-get update
- sudo apt-get install python-pip python-serial -y
- fi
- if ! [ -x "$(command -v mcstatus)" ]
- then
- sudo pip install mcstatus
- fi
- echo -e "Done";
- echo
- if [ $RPI3 = "YES" ] && [ $SERIAL = "YES" ]
- then
- echo "Raspberry 3 Serial setup:"
- if ! grep "dtoverlay=pi3-disable-bt" /boot/config.txt >/dev/null
- then
- sudo bash -c 'echo "" >>/boot/config.txt'
- sudo bash -c 'echo "# Disable internal BT" >>/boot/config.txt'
- sudo bash -c 'echo "dtoverlay=pi3-disable-bt" >>/boot/config.txt'
- sudo systemctl disable hciuart >/dev/null
- sleep 1
- fi
- if ! grep "consoleblank=0" /boot/cmdline.txt >/dev/null
- then
- sudo bash -c 'sed -i -e "s/rootwait/rootwait consoleblank=0/g" /boot/cmdline.txt'
- fi
- if grep "console=serial0,115200" /boot/cmdline.txt >/dev/null
- then
- sudo bash -c 'sed -i -e "s/console=serial0,115200//g" /boot/cmdline.txt'
- fi
- echo "Done"
- fi
|