/
install_ubuntu.sh
103 lines (96 loc) · 2.81 KB
/
install_ubuntu.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
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
#!/bin/bash
echo "**********************************************"
echo ""
echo "Compiling|Installing Okcash for"
uname -a
echo ""
echo "**********************************************"
echo ""
# Function to ask yes/no question
ask_question() {
while true; do
echo "$1 (yes/no)"
read answer
answer=$(echo "$answer" | tr '[:upper:]' '[:lower:]')
case "$answer" in
yes)
return 0
;;
no)
return 1
;;
*)
echo "Please answer yes or no."
;;
esac
done
}
# Ask if the user wants to install the OK node
if ask_question "Do you want to install the - okcashd - node?"; then
echo "Installing the okcashd node"
# Navigate to the appropriate directory and compile/install the node
cd oktools/ubuntu
chmod +x *
/bin/bash ./Compile_ubuntu_node.sh
echo "**********************************************"
echo ""
echo " - okcashd - node is now installed in your system."
echo ""
echo ""
else
echo ""
echo "OK, Enjoy!."
fi
# Ask if the user wants to install the GUI
if ask_question "Do you want to install the - Okcash GUI - (Qt Graphical User Interface)?"; then
echo "Installing the Okcash GUI..."
cd oktools/ubuntu
chmod +x *
/bin/bash ./Compile_ubuntu_GUI.sh
echo "**********************************************"
echo ""
echo "The Okcash GUI (Qt) is now installed in your system."
echo ""
else
echo ""
echo "OK, Enjoy!."
fi
# Ask if the user wants to install the First time sync file / ok-blockchain
echo "**********************************************"
echo ""
if ask_question "First Time Use? Do you want to Instant Sync [Download and instant sync the latest ok-blockchain?"; then
echo "Syncing Okcash for the first time..."
cd
cd okcash/oktools/ubuntu
/bin/bash ./9syncok.sh
echo "**********************************************"
echo ""
echo "okcash First time Sync is installed in your system."
echo ""
else
echo ""
echo "OK, Enjoy!."
fi
# Ask if the user wants to install sample okcash.conf file
echo "**********************************************"
echo ""
if ask_question "Need an okcash.conf file? Do you want to install the sample okcash.conf file in your system (okcashd node requirement)"; then
echo "Adding okcash.conf file to the system..."
cd
cd okcash/oktools/ubuntu
/bin/bash ./8startconfig.sh
echo "**********************************************"
echo ""
echo "okcash.conf is installed in your system."
echo ""
else
echo ""
echo "OK, Enjoy!."
fi
echo "**********************************************"
echo ""
echo "Done installing Okcash on its latest version for:"
uname -a
echo ""
echo "Get empowered with Okcash!"
exit 0