2024-01-22 22:06:38 +00:00
|
|
|
#!/bin/bash
|
|
|
|
export SWAP_DATADIR=$HOME/coinswaps
|
2024-09-16 20:58:53 +00:00
|
|
|
|
|
|
|
# Colors
|
|
|
|
red="echo -e -n \e[31;1m"
|
|
|
|
green="echo -e -n \e[32;1m"
|
|
|
|
nocolor="echo -e -n \e[0m"
|
|
|
|
|
|
|
|
# Check if basicswap is running
|
|
|
|
if [[ -f $SWAP_DATADIR/particl/particl.pid ]]; then
|
|
|
|
bsx_pid=$(cat $SWAP_DATADIR/particl/particl.pid)
|
|
|
|
if [[ $bsx_pid ]]; then
|
|
|
|
bsx_run=$(pidof particld | grep $bsx_pid)
|
|
|
|
if [[ $bsx_run ]]; then
|
|
|
|
$red"\nError: BasicSwapDEX is running.\n"; $nocolor
|
|
|
|
exit
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
2024-01-22 22:06:38 +00:00
|
|
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
2024-06-11 20:51:02 +00:00
|
|
|
|
|
|
|
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*
|
|
|
|
else
|
|
|
|
$HOME/.local/bin/bsx/update.sh
|
|
|
|
fi
|