-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathpotainstall.sh
72 lines (65 loc) · 1.73 KB
/
potainstall.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
66
67
68
69
70
71
72
#!/bin/bash
clear
# Update RPI
echo "Updating and Upgrading your Pi to newest standards"
sudo apt update -qq > /dev/null && sudo apt full-upgrade -qq -y > /dev/null && sudo apt clean > /dev/null
wait
#Install Node-Red
bash <(curl -sL https://raw.githubusercontent.com/node-red/linux-installers/master/deb/update-nodejs-and-nodered) <<!
y
y
!
wait
# Start NodeRed
sudo systemctl start nodered.service
sudo systemctl enable nodered.service
# Install git & Sqlite3
sudo apt-get install git sqlite3 -qq > /dev/null
wait
# Configure SQLITE
cd /home/pi
sqlite3 pota<< !
CREATE TABLE validparksdesignator(
"designator" TEXT type UNIQUE
);
CREATE TABLE designatoralert(
"designator" TEXT type UNIQUE
);
CREATE TABLE callsignalert(
"callsign" TEXT type UNIQUE
);
CREATE TABLE parkalert(
"park" TEXT type UNIQUE
);
CREATE TABLE huntedparks(
"DXCCEntity" TEXT,
"Location" TEXT,
"HASC" TEXT,
"Reference" TEXT type UNIQUE,
"ParkName" TEXT,
"FirstQSODate" TEXT,
"QSOs" INTEGER
);
CREATE TABLE locdescalert(
"locdesc" TEXT type UNIQUE
);
.exit
!
#configure NodeRed
node-red-stop
wait
cd /home/pi/.node-red
npm install @node-red-contrib-themes/theme-collection
mkdir projects
cd projects
echo "Cloning the Node-Red Dashboard"
git clone https://github.com/kylekrieg/Node-Red-POTA-Dashboard.git
cd Node-Red-POTA-Dashboard
npm --prefix ~/.node-red/ install ~/.node-red/projects/Node-Red-POTA-Dashboard/
curl -o settings.js https://gist.githubusercontent.com/kd9lsv/b114c87eb3f30b4d3cc53009d486978f/raw/c84a38d999ef8c4562237b531cfc4bcd5f26efab/settings.js
sudo systemctl restart nodered.service
HOSTIP=`hostname -I | cut -d ' ' -f 1`
if [ "$HOSTIP" = "" ]; then
HOSTIP="127.0.0.1"
fi
echo "Node Red has Completed. head to http://$HOSTIP:1880 ".