-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathfuncs.conf
33 lines (27 loc) · 940 Bytes
/
funcs.conf
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
function get_msg() {
printf "$(tput setaf 2)\n[ INFO ]$(tput sgr 0) $*\n"
}
function get_version() {
grep "^ID=" /etc/os-release | awk -F '=' '{print $2}'
}
function get_clone_repo() {
git clone -q https://github.com/binance-chain/bsc /opt/bsc
}
function get_latest_tag() {
curl -s "https://api.github.com/repos/binance-chain/bsc/tags" | jq -r '.[0].name'
}
function get_latest_release() {
curl -sL https://api.github.com/repos/binance-chain/bsc/releases/latest | jq -r '.assets[3].browser_download_url' | wget -qi -
}
function create_service_geth() {
systemctl daemon-reload
systemctl enable geth
systemctl start geth
}
function install_latest_go() {
LATEST=$(curl -s https://go.dev/VERSION?m=text)
curl -sOL https://golang.org/dl/${LATEST}.linux-amd64.tar.gz
tar -C /usr/local -xzf ${LATEST}.linux-amd64.tar.gz
echo "export PATH="$PATH:/usr/local/go/bin"" >> ~/.bashrc
rm -f ${LATEST}.linux-amd64.tar.gz
}