-
Notifications
You must be signed in to change notification settings - Fork 19
/
get-teslacam.sh
61 lines (53 loc) · 1.51 KB
/
get-teslacam.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/sh
set -e
echo "Installing TeslaCam"
install() {
# Download working copy of containerd for the Pi Zero
# https://github.com/docker/for-linux/issues/709#issuecomment-536295224
wget https://packagecloud.io/Hypriot/rpi/packages/raspbian/buster/containerd.io_1.2.6-1_armhf.deb/download.deb
sudo dpkg -i download.deb && sudo rm download.deb
curl -fsSL get.docker.com | sh
# adding local user to docker group
sudo usermod -aG docker $USER
mkdir -p ~/teslacam/video
mkdir -p ~/teslacam/.images
sudo -u $USER \
docker run \
--rm \
-v teslacam_ssh:/root/.ssh \
--entrypoint "ssh-keygen" \
teslacam/dashcam-monitor \
-f /root/.ssh/id_rsa -q -N ""
sudo -u $USER \
docker run \
--rm \
-it \
-v teslacam_ssh:/root/.ssh \
--entrypoint "ssh-copy-id" \
teslacam/dashcam-monitor \
echo "Installing Dashcam Monitor"
sudo -u $USER \
docker run \
--restart=always \
-d \
-v teslacam_ssh:/root/.ssh \
-v ~/teslacam/video:/home/pi/teslacam/video \
-v /mnt:/mnt \
-e "USE_SSH=true" \
-e "IMAGE_SIZE_MB=3072" \
-e "IMAGE_DIR=~/teslacam/.images" \
-e "BACKUP_DIR=~/teslacam/video" \
--name dashcam-monitor \
teslacam/dashcam-monitor
echo "Installing Clip Cleaner"
sudo -u $USER \
docker run \
--restart=always \
-d \
-v /home/pi/teslacam/video:/video \
-e "NUMBER_OF_DAYS_TO_KEEP=2" \
--name clean-recent-clips \
teslacam/clean-recent-clips
}
install