forked from nahuhh/basicswap-bash
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbsx-update
More file actions
executable file
·43 lines (37 loc) · 935 Bytes
/
bsx-update
File metadata and controls
executable file
·43 lines (37 loc) · 935 Bytes
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
#!/bin/bash
source $HOME/.local/bin/bsx/shared.sh
if [[ $1 = "--force" ]]; then
green "Force updating"
else
is_running
fi
is_tails
# Cleanup old version
if [ -f /usr/local/bin/bsx/update.sh ]; then
/usr/local/bin/bsx/update.sh
cd /usr/local/bin
sudo rm -rf basicswap-bash bsx*
fi
# Download updated scripts
echo "Updating basicswap-bash scripts" && sleep 1
cd $SWAP_DATADIR/basicswap || {
red "Cannot find datadir. Update failed"
exit 1
}
if [[ -d basicswap-bash ]]; then
cd basicswap-bash
git pull || {
red "Failed to update repo. Cancelling update."
exit 1
}
else
git clone https://github.com/nahuhh/basicswap-bash || {
red "Failed to clone repo. Cancelling update."
exit 1
}
cd basicswap-bash
fi
# Cleanup old
[[ -f $HOME/.local/bin/install.sh ]] && rm $HOME/.local/bin/install.sh
# Update BasicSwap, coincurve and coin cores
./bsx/update.sh