-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
90 lines (74 loc) · 2.63 KB
/
index.html
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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
#!/bin/sh
set -e
__dirname=$(cd $(dirname "$0"); pwd -P)
cd "${__dirname}"
# DroneDB for Linux installation script
#
# See https://docs.dronedb.app for more information.
#
# This script is meant for quick & easy install via:
# $ curl -fsSL https://get.dronedb.app -o get-ddb.sh
# $ sh get-ddb.sh
#
# NOTE: Make sure to verify the contents of the script
# you downloaded matches the contents of install.sh
# located at https://github.com/DroneDB/DroneDB/scripts/linux_install_script.sh
# before executing.
#
LATEST_RELEASE="https://github.com/DroneDB/DroneDB/releases/download/v1.0.12/ddb-1.0.12-linux.tgz"
command_exists() {
command -v "$@" > /dev/null 2>&1
}
do_install() {
echo "# Executing DroneDB install script"
echo "# Downloading $LATEST_RELEASE..."
curl -fsSL $LATEST_RELEASE -o /tmp/ddb.tgz
if [ ! -e ~/.local ]; then
mkdir -p ~/.local
fi
echo "# Extracting..."
tar -zxf /tmp/ddb.tgz -C ~/.local
echo "# Setting up..."
if [ -e ~/.local/exodus ]; then
echo "# Removing previous version of ddb..."
if [ -e ~/.local/ddb ]; then
rm -r ~/.local/ddb
fi
mv ~/.local/exodus ~/.local/ddb
if [ -e ~/.bashrc ]; then
if test ! $(command_exists ddb); then
echo "# Adding ~/.local/ddb/bin to PATH in .bashrc"
echo "export PATH=\$PATH:\$HOME/.local/ddb/bin" >> ~/.bashrc
fi
else
echo "# Program installed in $HOME/.local/ddb/bin. Make sure to add this path to your PATH environment variable."
fi
else
echo "! Cannot install DroneDB: ~/.local/exodus not found. This might be a bug. Please open an issue on https://github.com/DroneDB/DroneDB/issues"
exit 1
fi
echo "# Cleaning up..."
if [ -e /tmp/ddb.tgz ]; then
rm /tmp/ddb.tgz
fi
echo ""
echo " ____ ____ ____ "
echo " / __ \_________ ____ ___ / __ \/ __ )"
echo " / / / / ___/ __ \/ __ \/ _ \/ / / / __ |"
echo " / /_/ / / / /_/ / / / / __/ /_/ / /_/ / "
echo "/_____/_/ \____/_/ /_/\___/_____/_____/ "
echo " "
echo "Type: ddb --help or visit https://docs.dronedb.app to get started!"
echo ""
if [ -z "$SHELL" ] && [ -e /bin/bash ]; then
export SHELL=/bin/bash
fi
if [ -e $SHELL ] && [ -e ~/.bashrc ]; then
$SHELL
else
echo "Important! Manually update your PATH to include $HOME/.local/ddb/bin"
fi
}
# wrapped up in a function so that we have some protection against only getting
# half the file during "curl | sh"
do_install