forked from CBzeek/Nodes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
aptos-seed-add.sh
36 lines (27 loc) · 924 Bytes
/
aptos-seed-add.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
#!/bin/bash
echo 'Stopping aptos node...'
sudo systemctl stop aptosd
echo 'Done'
sleep 2
cd $HOME
echo 'Backup configuration files...'
cp -r $HOME/.aptos $HOME/aptos_backup_$(date +%F--%R)
echo 'Done'
sleep 2
echo 'Check for yq...'
if [ -f /usr/local/bin/yq ]; then
echo 'yq installed'
else
echo 'yq not stalled, starting install...'
wget -q -O /usr/local/bin/yq https://github.com/mikefarah/yq/releases/download/v4.23.1/yq_linux_amd64 && chmod +x /usr/local/bin/yq
echo 'Done'
fi
echo 'Add seeds to configuration file...'
wget -O $HOME/seeds.yaml https://raw.githubusercontent.com/Pa1amar/aptos/main/seeds.yaml
/usr/local/bin/yq ea -i 'select(fileIndex==0).full_node_networks[0].seeds = select(fileIndex==1).seeds | select(fileIndex==0)' $HOME/.aptos/config/public_full_node.yaml $HOME/seeds.yaml
echo 'Done'
sleep 2
echo 'Starting aptos node...'
sudo systemctl restart aptosd
echo 'Done'
sleep 2