-
Notifications
You must be signed in to change notification settings - Fork 8
/
Copy pathgaganode_install.sh
44 lines (39 loc) · 1.25 KB
/
gaganode_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
#!/bin/bash
cpu_arch="$(uname -m)"
echo "cpu_arch=$cpu_arch"
if [[ ! ("$cpu_arch" == "x86_64" || "$cpu_arch" == "amd64" || "$cpu_arch" == "arm64" || "$cpu_arch" == "aarch64") ]]; then
echo "Your CPU type is not supported."
exit 1
fi
echo "DOWNLOADLINK=$DOWNLOADLINK"
echo "FILENAME=$FILENAME"
echo "TOKEN=$TOKEN"
if [ -d ./apphub-linux* ]; then
echo "apphub-linux found" &&
cd ./apphub-linux* &&
sudo ./apphub service start &&
sudo ./apphub status &&
sudo ./apphub log &&
sudo ./apps/gaganode/gaganode log &&
cat ./apps/gaganode/user_conf/default.toml
else
echo "apphub-linux does not exist" &&
sudo curl -o $FILENAME $DOWNLOADLINK &&
sudo tar -zxf $FILENAME &&
sudo rm -f $FILENAME &&
cd ./apphub-linux* &&
sudo ./apphub service remove &&
sudo ./apphub service install
sudo ./apphub service start
sudo ./apphub status &&
sleep 30 && echo ' ____ ___ _ _ _____
| _ \ / _ \| \ | | ____|
| | | | | | | \| | _|
| |_| | |_| | |\ | |___
|____/ \___/|_| \_|_____|'
sudo ./apphub status &&
sudo ./apps/gaganode/gaganode config set --token=$TOKEN &&
sudo ./apphub restart &&
sudo ./apps/gaganode/gaganode log
fi
/bin/bash