basicswap-bash/bsx-placeorder

29 lines
717 B
Text
Raw Permalink Normal View History

2024-10-03 01:52:59 +00:00
#!/bin/bash
export SWAP_DATADIR=$HOME/coinswaps
2024-11-09 20:42:32 +00:00
if [[ $USER == amnesia ]]; then
export SWAP_DATADIR=$HOME/Persistent/coinswaps
fi
2024-10-03 01:52:59 +00:00
# Colors
2024-11-09 03:03:53 +00:00
red="printf \e[31;1m"
green="printf \e[32;1m"
nocolor="printf \e[0m"
2024-10-03 01:52:59 +00:00
# Check if basicswap is running
if [[ -f $SWAP_DATADIR/particl/particl.pid ]]; then
bsx_pid=$(cat $SWAP_DATADIR/particl/particl.pid)
2024-11-09 03:03:53 +00:00
bsx_run=$(pgrep particld | grep $bsx_pid)
2024-10-03 01:52:59 +00:00
if ! [[ $bsx_run ]]; then
$red"\nError: BasicSwapDEX must be running.\n"; $nocolor
exit
fi
else
$red"\nError: BasicSwapDEX must be running.\n"; $nocolor
exit
fi
2024-11-09 03:03:53 +00:00
cp $HOME/.local/bin/bsx/placeorders/* $SWAP_DATADIR/basicswap/scripts/.
2024-10-03 01:52:59 +00:00
cd $SWAP_DATADIR/basicswap/scripts/
./placeorders.sh