-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathnodeSetup.sh
More file actions
executable file
·38 lines (38 loc) · 1.04 KB
/
nodeSetup.sh
File metadata and controls
executable file
·38 lines (38 loc) · 1.04 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
#!/bin/bash
echo "Initializing $1"
echo "Adding user pi to dialout"
usermod -a -G dialout pi
cd /home/pi
echo "Downloading git"
apt install git
echo "Installing rpi.gpio"
apt install rpi.gpio
echo "Installing pip3"
apt install python3-pip
echo "Installing pyserial"
pip3 install pyserial
echo "Enabling serial UART"
sed -i -e 's/ console=serial0,115200//g' /boot/cmdline.txt
echo 'enable_uart=1' >> /boot/config.txt
echo "Enabling SPI"
echo 'dtparam=spi=on' >> /boot/config.txt
echo "Downloading LMIC"
git clone https://github.com/wklenk/lmic-rpi-lora-gps-hat.git
chown -R pi:pi lmic-rpi-lora-gps-hat
echo "Downloading WiringPi"
git clone git://git.drogon.net/wiringPi
chown -R pi:pi wiringPi
echo "Installing WiringPi"
cd /home/pi/wiringPi
git pull origin
./build
cd /home/pi
echo "Enabling SSH."
systemctl enable ssh
echo "Changing keyboard layout"
sed -i -e 's/XKBLAYOUT="gb"/XKBLAYOUT="us"/g' /etc/default/keyboard
echo "Changing Hostname"
sed -i -e "s/raspberrypi/$1/g" /etc/hostname
sed -i -e "s/raspberrypi/$1/g" /etc/hosts
echo "Installing fail2ban"
reboot