-
Notifications
You must be signed in to change notification settings - Fork 2
/
setup
35 lines (27 loc) · 1.22 KB
/
setup
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
#!/bin/sh
echo "Editing crontab to run startup script at reboot"
#Trying this for root user, pi user can't seem to use @reboot, we'll see if this messes things up later
sudo crontab -l -u root | cat - setup-files/crontab-addition.txt | sudo crontab -u root -
echo "Fixing script permissions (git may not retain permissions)"
chmod +x scripts/set-network
chmod +x scripts/startup
chmod +x scripts/tool-permissions
echo "Setting up /etc/network/interfaces files"
#We don't want to accidently override the stored default file
line=$(sed '1!d' /etc/network/interfaces)
if [ "$line" != "#KUKA" ]
then
sudo cp /etc/network/interfaces /etc/network/interfaces-default
fi
cd /home/pi/kuka-rpi-controller/setup-files
sudo cp interfaces /etc/network/interfaces
sudo cp interfaces /etc/network/interfaces-kuka
echo "Enabling i2c functions and installing i2c packages"
sudo sed -i '4 s/^/#/' /etc/modprobe.d/raspi-blacklist.conf
echo "i2c-dev" | sudo tee --append /etc/modules > /dev/null
sudo apt-get -qq update
sudo apt-get -qq install i2c-tools
sudo apt-get -qq install python3-smbus
sudo adduser pi i2c
echo "Pi will need to be rebooted for i2c to be functional"
echo "If Processing is not already installed, it will need to be installed manually"