-
Notifications
You must be signed in to change notification settings - Fork 9
/
install.sh
executable file
·72 lines (56 loc) · 1.41 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
62
63
64
65
66
67
68
#!/usr/bin/env bash
URL="http://172.16.0.101/frigate"
# name will be generate like 'frigate_v${VERSION}_${OS}${EXT}'
VERSION="1.0.2"
EXT=".tar.gz"
OS=""
function install() {
name="frigate_v${VERSION}_${OS}"
path="${URL}/${name}${EXT}"
rm ${name}${EXT}
rm ${name}
echo "download ${path} ..."
curl -O ${path}
tar xvf ${name}${EXT}
rm ${name}${EXT}
echo "move frigate to /usr/local/bin"
mv ${name} /usr/local/bin/frigate
if [$? != 0]; then
mv ${name} frigate
echo -e "\033[31m Please add frigate to path by yourself"
else
echo -e "\033[32mInstall successfully, Please use the command below to initial your test directory: \033[0m "
echo -e "\033[32m\t mkdir test && cd test\033[0m"
echo -e "\033[32m\t frigate init \033[0m"
fi
}
function getLinuxReleaseType(){
release=$(cat /etc/*release*)
case ${release} in
*"CentOS Linux release 7"*)
echo "CentOS7"
OS="centos7"
;;
*)
echo "unsupported Linux release: ${release}"
exit 1
;;
esac
}
function getOSType(){
case "$(uname)" in
"Darwin")
echo "Darwin"
OS="darwin"
;;
"Linux")
echo "Linux"
getLinuxReleaseType
;;
*)
echo "Unsupported now"
;;
esac
}
getOSType
install