forked from AllskyTeam/allsky
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·61 lines (52 loc) · 1.8 KB
/
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
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
RED='\033[0;31m'
GREEN='\033[0;32m'
NC='\033[0m' # No Color
echo -en '\n'
echo -e "${RED}**********************************************"
echo "*** Welcome to the Allsky Camera installer ***"
echo -e "**********************************************${NC}"
echo -en '\n'
echo -en "${GREEN}* Dependencies installation\n${NC}"
apt-get update && apt-get install libopencv-dev libusb-dev ffmpeg gawk lftp jq imagemagick -y
echo -en '\n'
echo -en "${GREEN}* Compile allsky software\n${NC}"
make all
echo -en '\n'
echo -en "${GREEN}* Sunwait installation"
cp sunwait /usr/local/bin
echo -en '\n'
echo -en "${GREEN}* Using the camera without root access\n${NC}"
install asi.rules /etc/udev/rules.d
udevadm control -R
echo -en '\n'
echo -en "${GREEN}* Autostart script\n${NC}"
sed -i '/allsky.sh/d' /etc/xdg/lxsession/LXDE-pi/autostart
cp autostart/allsky.service /lib/systemd/system/
chown root:root /lib/systemd/system/allsky.service
chmod 0644 /lib/systemd/system/allsky.service
echo -en '\n'
echo -en "${GREEN}* Configure log rotation\n${NC}"
cp autostart/allsky /etc/logrotate.d/
chown root:root /etc/logrotate.d/allsky
chmod 0644 /etc/logrotate.d/allsky
cp autostart/allsky.conf /etc/rsyslog.d/
chown root:root /etc/rsyslog.d/allsky.conf
chmod 0644 /etc/rsyslog.d/allsky.conf
echo -en '\n'
echo -en "${GREEN}* Copy camera settings files\n${NC}"
cp settings.json.repo settings.json
cp config.sh.repo config.sh
cp scripts/ftp-settings.sh.repo scripts/ftp-settings.sh
chown -R pi:pi ../allsky
systemctl daemon-reload
systemctl enable allsky.service
echo -en '\n'
echo -en '\n'
echo -en "The Allsky Software is now installed. You should reboot the Raspberry Pi to finish the installation\n"
echo -en '\n'
read -p "Do you want to reboot now? [y/n] " ans_yn
case "$ans_yn" in
[Yy]|[Yy][Ee][Ss]) reboot now;;
*) exit 3;;
esac