-
Notifications
You must be signed in to change notification settings - Fork 1
/
meye-installer
executable file
·60 lines (55 loc) · 1.76 KB
/
meye-installer
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
#!/bin/bash
# MotionEYE installer for Debian & Ubuntu
ARCH=`uname -m`
if [ $# -eq 0 ]; then
echo "Missing options!"
echo "(run $0 -h for help)"
echo ""
exit 0
fi
while getopts "iuh" OPTION; do
case $OPTION in
i)
if [[ "$ARCH" == "armv6l" || "$ARCH" == "armv7l" || "$ARCH" == "aarch64" ]]; then
sudo apt update; sudo apt upgrade -y
if [[ "$ARCH" == "armv6l" || "$ARCH" == "armv7l" ]]; then
sudo apt --no-install-recommends install -y ca-certificates curl python3 python3-distutils
fi
if [[ "$ARCH" == "aarch64" ]]; then
sudo apt --no-install-recommends install -y ca-certificates curl python3 python3-dev libcurl4-openssl-dev gcc libssl-dev
fi
curl -sSfO 'https://bootstrap.pypa.io/get-pip.py'
sudo python3 get-pip.py
rm -f get-pip.py
if [[ "$ARCH" == "armv6l" || "$ARCH" == "armv7l" ]]; then
printf '%b' '[global]\nextra-index-url=https://www.piwheels.org/simple/\n' | sudo tee /etc/pip.conf > /dev/null
fi
sudo python3 -m pip install 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'
sudo motioneye_init
else
echo -e "$ARCH is not supported by this script."
fi
;;
u)
if [[ "$ARCH" == "armv6l" || "$ARCH" == "armv7l" || "$ARCH" == "aarch64" ]] && [[ `systemctl status motioneye | grep -w "meyectl"` ]]; then
sudo systemctl stop motioneye
sudo python3 -m pip install --upgrade --force-reinstall --no-deps 'https://github.com/motioneye-project/motioneye/archive/dev.tar.gz'
sudo systemctl start motioneye
else
echo -e "$ARCH is not supported by this script."
fi
;;
h)
echo -e ""
echo -e "MotionEYE installer"
echo -e ""
echo -e "\t-i\tInstall"
echo -e "\t-u\tUpdate"
echo -e ""
echo -e "\t-h\tHelp"
echo -e ""
exit 0
;;
esac
done
exit 0