-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathupdate.sh
45 lines (34 loc) · 1.34 KB
/
update.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
#!/bin/bash
VERSION='v0.1.20'
PATCH="246b9dd"
echo "Update Titan node ${VERSION}"
echo "..."
echo "Stop titand.service & remove old version"
systemctl stop titand.service && rm -rf /usr/local/titan
echo "..."
echo "Download Titan node ${VERSION}"
# Tải xuống tệp cài đặt Titan
wget https://github.com/Titannet-dao/titan-node/releases/download/${VERSION}/titan-l2edge_${VERSION}_patch_linux_amd64.tar.gz
sudo tar -xf titan-l2edge_${VERSION}_patch_linux_amd64.tar.gz -C /usr/local
sudo mv /usr/local/titan-edge_${VERSION}_${PATCH}_linux_amd64 /usr/local/titan
sudo cp /usr/local/titan/libgoworkerd.so /usr/lib/libgoworkerd.so
rm titan-l2edge_${VERSION}_patch_linux_amd64.tar.gz
# Định nghĩa nội dung cần thêm
content="
export PATH=\$PATH:/usr/local/titan
export LD_LIBRARY_PATH=\$LD_LIZBRARY_PATH:./libgoworkerd.so
"
# Kiểm tra nếu file ~/.bash_profile chưa tồn tại thì tạo mới, nếu đã tồn tại thì ghi thêm
if [ ! -f ~/.bash_profile ]; then
echo "$content" > ~/.bash_profile
source ~/.bash_profile
else
echo "$content" >> ~/.bash_profile
source ~/.bash_profile
fi
echo "Export PATH ~/.bash_profile"
echo "Restart titand.service"
sudo systemctl restart titand.service
sleep 8
# Hiển thị thông tin và cấu hình của titan-edge
sudo systemctl status titand.service && titan-edge config show && titan-edge info