-
Notifications
You must be signed in to change notification settings - Fork 15
/
Copy pathst_eve.sh
executable file
·66 lines (52 loc) · 1.5 KB
/
st_eve.sh
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
#!/bin/bash
#Add user
echo "Change the password for the administrative user (pi)"
passwd pi
echo "Creating the user that runs the experiment (eve)"
adduser eve
adduser eve pi
adduser eve sudo
adduser eve gpio
adduser eve i2c
#Change the timezone
echo -n "Enter the timezone: "
read timez
mv /etc/localtime /etc/localtime.backup
ln -sf /usr/share/zoneinfo/$timez /etc/localtime
echo "Changed."
echo ""
#Change the hostname
read -r -p "Enter the Hostname (Network Name) of the Device: " hostn
hostnamectl set-hostname $hostn
echo "Changed."
echo ""
#Enable I2C
echo "dtparam=i2c_arm=on" >> /boot/config.txt
echo "i2c-dev" >> /etc/modules
#Install Packages
apt update -y && apt upgrade -y
apt install -y git python3 python3-pip libatlas-base-dev
#apt install -y nfs-kernel-server vim tmux
umask 022
pip3 install adafruit-circuitpython-ads1x15 adafruit-circuitpython-mcp230xx adafruit-circuitpython-onewire adafruit-circuitpython-ds18x20 adafruit-circuitpython-pca9685 numpy slackclient==1.3.2 pandas matplotlib configparser tornado dash
#Git Clone Repo
mkdir /eve
git clone https://github.com/vishhvaan/eve-pi.git /eve
#Copy Service to Location
cp /eve/webui/eve_webui.service /lib/systemd/system/eve_webui.service
chmod 644 /lib/systemd/system/eve_webui.service
systemctl enable eve_webui
#Setup file storage
#Setup WebUI
/eve/webui/tools/init.py --no-npm
#Reboot
echo ""
echo ""
echo "Setup Complete."
read -r -p "Reboot Now? (Y/n): " reb_tog
case "$reb_tog" in
[yY][eE][sS]|[yY])
reboot
;;
*)
esac