-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathutils.sh
86 lines (68 loc) · 1.67 KB
/
utils.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
printColor() {
local color=$1
local text=$2
case $color in
"green")
echo -e "\e[1m\e[32m${text}\e[0m" ;;
"red")
echo -e "\e[1m\e[31m${text}\e[0m" ;;
"blue")
echo -e "\e[1m\e[34m${text}\e[0m" ;;
"yellow")
echo -e "\e[1m\e[33m${text}\e[0m" ;;
"black")
echo -e "\e[1m\e[30m${text}\e[0m" ;;
*)
echo "Unsupported color" ;;
esac
}
function logo {
bash <(curl -s https://raw.githubusercontent.com/UnityNodes/scripts/main/logo.sh)
}
function printLine {
echo "---------------------------------------------------------------------------------------"
}
function addToPath {
if ! echo "$PATH" | grep -q "${1}" ; then
echo "export PATH=\$PATH:${1}" >> $HOME/.bash_profile
source $HOME/.bash_profile
fi
}
function printAddition {
echo -e "\e[4m${1}\e[0m"
}
function printGreen {
echo -e "\e[1m\e[32m${1}\e[0m"
}
function printRed {
echo -e "\e[1m\e[31m${1}\e[0m"
}
function printBlue {
echo -e "\e[1m\e[34m${1}\e[0m"
}
function printYellow {
echo -e "\e[1m\e[33m${1}\e[0m"
}
function anima() {
local -i width=50
local -i progress=0
local -i step=7
while ((progress <= width)); do
local bar="["
for ((i = 0; i < progress; i++)); do
bar+="="
done
for ((i = progress; i < width; i++)); do
bar+=" "
done
bar+="]"
printf "\r%s %d%%" "$bar" "$((progress * 100 / width))"
((progress += step))
sleep 0.05
done
}
#Chain-id
wardenchain=buenavista-1
sidechain=S2-testnet-2
ogchain=zgtendermint_16600-1
initchain=initiation-1