-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstallSystemd.sh
More file actions
executable file
·66 lines (52 loc) · 1.93 KB
/
Copy pathinstallSystemd.sh
File metadata and controls
executable file
·66 lines (52 loc) · 1.93 KB
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
#!/bin/bash
# bash <(curl -fsSL "https://github.com/venari/timelapse/raw/feature/systemd-merge/installSystemd.sh?$RANDOM")
# Ask user if we have a waveshare modem
read -p "Does this camera have a waveshare SIM7600X modem? (y/n)" waveshare
cd /home/pi
# Check if dev folder exists
if [ ! -d "/home/pi/dev/timelapse" ]; then
echo Cloning repo...
mkdir -p dev
cd dev
git clone https://github.com/venari/timelapse.git
cd timelapse
git config pull.rebase false
# git checkout development
git checkout feature/systemd-merge
else
echo Updating repo...
cd dev/timelapse
# git checkout development
git fetch
git stash
git checkout feature/systemd-merge
git pull
git stash pop
fi
# Clear out any old crontab entries
# (echo "@reboot /usr/bin/bash /home/pi/dev/timelapse/scripts/loggingSocketServer.sh")| crontab -
crontab -r
echo Installing systemd services...
sudo cp /home/pi/dev/timelapse/systemd/system/*.* /etc/systemd/system/
sudo chmod u+x /etc/systemd/system/enviro*.*
sudo systemctl enable envirocam-telemetry.service
sudo systemctl enable envirocam-photos.timer
sudo systemctl enable envirocam-upload.timer
sudo systemctl enable envirocam-detect-hang.timer
# If not bookworm - don't have epaper library yet
if ! grep -q "bookworm" /etc/os-release; then
sudo cp /home/pi/dev/timelapse/systemd/system/envirocam-status.timer /etc/systemd/system/
sudo systemctl enable envirocam-status.timer
fi
# If not waveshare, we can't access SMS messages
if [ $waveshare == "y" ]; then
sudo cp /home/pi/dev/timelapse/systemd/system/envirocam-sms.timer /etc/systemd/system/
sudo systemctl enable envirocam-sms.timer
fi
echo We need to reboot to clear out cron jobs and kick off systemd jobs
echo "Press any key to reboot"
echo ===========================================
echo Please check battery profile in pijuice_cli
echo ===========================================
read -n 1 -s
sudo reboot