-
Notifications
You must be signed in to change notification settings - Fork 4
/
install.sh
executable file
·57 lines (48 loc) · 1.35 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
#!/bin/bash
## This scripts check if the [golang, wget and mysql] are instaled.
## If yes, it create the Navio database and copy the binary to /usr/local/bin
#Make
make
echo "ok"
# Check golang ...
if go version > /dev/null; then
echo "Check golang ok"
else
echo "Check golang fail"
echo "Install it an run this script again."
exit 1
fi
# Check wget ...
if wget --version > /dev/null ; then
echo "Check wget ok"
else
echo "Check wget fail"
echo "Install it an run this script again."
exit 1
fi
# Check mysql ...
if mysql --version > /dev/null; then
echo "Check mysql ok"
else
echo "Check mysql fail"
echo "Install it an run this script again."
exit 1
fi
#CREATE NAVIO DATABASE
go run ./database/up.go
# Check navio database ...
navio=`mysql -uroot -proot -e 'show databases;' | grep navio`
if [ "navio" == $navio ]; then
echo "Up database ok"
else
echo "Up database fail"
echo ""
echo "Expected Database user: root"
echo "Expected Database passwd: root"
fi
# INSTALL THE BINARY
if sudo cp ./navio /usr/local/bin; then
echo "Copy ./navio --> /usr/local/bin ok"
else
echo "Copy ./navio --> /usr/local/bin fail"
fi