-
Notifications
You must be signed in to change notification settings - Fork 0
/
install
78 lines (66 loc) · 2.52 KB
/
install
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
73
74
75
76
77
78
# WildlifeSystems
#
# This script is part of the WildlifeSystems project. For further information
# please refer to https://docs.wildlife.systems, or for more information on
# the project itself, please refer to https://wildlife.systems.
#Update system
apt-get update
apt-get install -y ufw jq
wget https://github.com/Wildlife-Systems/ws-node/raw/master/ws-heartbeat
chmod +x ws-heartbeat
chown root:root ws-heartbeat
mv ws-heartbeat /usr/bin
ws-heartbeat install
wget https://github.com/Wildlife-Systems/ws-node/raw/master/ws-setup
chmod +x ws-setup
chown root:root ws-setup
mv ws-setup /usr/bin
wget https://github.com/Wildlife-Systems/ws-node/raw/master/ws-run
chmod +x ws-run
chown root:root ws-run
mv ws-run /usr/bin
wget https://github.com/Wildlife-Systems/ws-node/raw/master/ws-indicate
chmod +x ws-indicate
chown root:root ws-indicate
mv ws-indicate /usr/bin4
wget https://github.com/Wildlife-Systems/ws-node/raw/master/ws-network
chmod +x ws-network
chown root:root ws-network
mv ws-network /usr/bin
wget https://raw.githubusercontent.com/Wildlife-Systems/ws-node/master/.ws.conf
OS="UNKNOWN"
OS_REPORTED=$(grep '^NAME=' /etc/os-release | cut -d '"' -f 2)
if [[ "$OS_REPORTED" == "Debian GNU/Linux" ]]; then
OS="Debian"
if [[ -f "/etc/apt/sources.list.d/raspi.list" ]]; then
OS="Raspbian"
fi
else
if [[ "$OS_REPORTED" == "Ubuntu" ]]; then
OS="Ubuntu"
wget https://github.com/Wildlife-Systems/ws-node/raw/master/os/ubuntu/etc/ws
chown root:root ws
mv ws /etc/sudoers.d
fi
fi
CONF=$(jq --arg os $OS '.+{os:$os}' .ws.conf)
echo "$CONF" > .ws.conf
if [[ "$OS_REPORTED" == "Ubuntu" ]]; then
#Install raspi-config
apt-get install lua5.1 alsa-utils triggerhappy iw crda
wget https://archive.raspberrypi.org/debian/pool/main/r/raspi-config/raspi-config_20230214_all.deb
dpkg -i raspi-config_20230214_all.deb
rm raspi-config_20230214_all.deb
#Need to install whois package to get mkpasswd
apt-get install whois
fi
#Install the abstraction layers
wget -O - https://raw.githubusercontent.com/Wildlife-Systems/sensor-control/main/install | sudo bash
wget -O - https://github.com/wildlife-systems/sound-device-control/raw/master/install | sudo bash
wget -O - https://github.com/Wildlife-Systems/image-device-control/raw/master/install | sudo bash
wget -O - https://github.com/wildlife-systems/pi-pwr/raw/master/install | sudo bash
if [[ "$1" == "unattended" ]]; then
exit 0;
fi
echo $""
echo "Please run ws-setup to configure this node."