-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathrpc.sh
42 lines (32 loc) · 1.29 KB
/
rpc.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
#!/bin/bash
echo "Kill Avail Light Client Service..."
pkill -9 avail-light
echo "------------------ Remove Avail Path & Old Config ------------------------"
rm -rf /root/avail-light/config.yml
rm -rf /root/avail_path
echo "------------------ Create New Config ------------------------"
curl -O https://raw.githubusercontent.com/vinatechpro/avail-install/main/config.yml && cp -r config.yml /root/avail-light
echo ""
echo "------------------ Remove File Avail Systemd ------------------------"
rm -rf /etc/systemd/system/avail-light.service
echo "------------------ Create New File Avail Light Systemd ------------------------"
touch /etc/systemd/system/avail-light.service
echo "[Unit]
Description=Avail Light Client
After=network.target
StartLimitIntervalSec=0
[Service]
User=root
WorkingDirectory=/root
ExecStart= /root/avail-light/target/release/avail-light --config /root/avail-light/config.yml --identity /root/avail-light/target/release/identity.toml
Restart=always
RestartSec=120
[Install]
WantedBy=multi-user.target" > /etc/systemd/system/avail-light.service
echo "------------------ Restart Avail Service ------------------------"
systemctl daemon-reload
systemctl enable avail-light.service && systemctl start avail-light.service
sleep 3
systemctl status avail-light.service
# Exit the script
exit