forked from n1kdo/n1mm_view
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathrpi_install.sh
executable file
·44 lines (39 loc) · 1.38 KB
/
rpi_install.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
#!/bin/env bash
# git clone https://github.com/n1kdo/n1mm_view.git
# cd n1mm_view
# pip install numpy
if [ $EUID -ne 0 ]; then
echo "This part of setup needs full system access."
echo "You can simply type: "
echo " sudo !!"
echo "at the next prompt. This allows the script to install the libraries and packages required."
exit 1
fi
apt-get update
apt-get -y upgrade
apt-get -y install python-dev apache2
apt-get install -y git python3-dev python3-pygame python3-matplotlib python3-cartopy python3-pykdtree python3-scipy
# ramdisk and Apache
mkdir -p /mnt/ramdisk
mkdir -p /mnt/ramdisk_backup
mount -t tmpfs -o rw,size=2G tmpfs /mnt/ramdisk
if [ $(grep -q "/mnt/ramdisk" "/etc/fstab") ]
then
echo "tmpfs /mnt/ramdisk tmpfs rw,size=2G 0 0" >> /etc/fstab
else
echo "Warning: Filesystem table already shows ramdisk. Skipping."
fi
mount -a
# persist ramdisk contents
cp ./init/*.service /lib/systemd/system/.
systemctl enable ramdisk-sync.service
systemctl start ramdisk-sync
# Change HTML_DIR in n1mm_view_config.py to /var/ram/n1mm_view/html (or something similar).
mkdir -p /mnt/ramdisk/n1mm_view/html
sudo chgrp -R www-data /mnt/ramdisk/n1mm_view
cp ./apache2/conf-available/n1mm_view.conf /etc/apache2/conf-available/.
a2enconf n1mm_view
apache2ctl restart
echo
echo "Remember to update config.py file with your settings before starting the collector and dashboard."
echo