mirror of
https://github.com/nahuhh/basicswap-bash.git
synced 2025-01-03 17:39:56 +00:00
Compare commits
3 commits
4d46146657
...
4f6a58c29a
Author | SHA1 | Date | |
---|---|---|---|
|
4f6a58c29a | ||
|
5a3e24441d | ||
|
acc3702c50 |
10 changed files with 131 additions and 18 deletions
|
@ -1,5 +1,21 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
python3 -m venv "$SWAP_DATADIR/venv"
|
|
||||||
|
# Colors
|
||||||
|
red="echo -e -n \e[31;1m"
|
||||||
|
green="echo -e -n \e[32;1m"
|
||||||
|
nocolor="echo -e -n \e[0m"
|
||||||
|
|
||||||
|
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 already running.\n"; $nocolor
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
$HOME/.local/bin/bsx/startup.sh
|
$HOME/.local/bin/bsx/startup.sh
|
||||||
|
|
15
bsx-addcoin
15
bsx-addcoin
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
red="echo -e -n \e[31;1m"
|
red="echo -e -n \e[31;1m"
|
||||||
green="echo -e -n \e[32;1m"
|
green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
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
|
||||||
|
|
||||||
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
||||||
until [[ "$l" =~ ^[12]$ ]]; do
|
until [[ "$l" =~ ^[12]$ ]]; do
|
||||||
read -p 'Select an option [1|2]: ' l
|
read -p 'Select an option [1|2]: ' l
|
||||||
|
@ -28,6 +41,6 @@ read -p 'Select an option [1|2]: ' l
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
$HOME/.local/bin/bsx/addcoin.sh
|
$HOME/.local/bin/bsx/addcoin.sh
|
||||||
|
|
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
red="echo -e -n \e[31;1m"
|
red="echo -e -n \e[31;1m"
|
||||||
green="echo -e -n \e[32;1m"
|
green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
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
|
||||||
|
|
||||||
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
||||||
until [[ "$l" =~ ^[12]$ ]]; do
|
until [[ "$l" =~ ^[12]$ ]]; do
|
||||||
read -p 'Select an option [1|2]: ' l
|
read -p 'Select an option [1|2]: ' l
|
||||||
|
@ -28,6 +41,6 @@ read -p 'Select an option [1|2]: ' l
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
$HOME/.local/bin/bsx/disabletor.sh
|
$HOME/.local/bin/bsx/disabletor.sh
|
||||||
|
|
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
red="echo -e -n \e[31;1m"
|
red="echo -e -n \e[31;1m"
|
||||||
green="echo -e -n \e[32;1m"
|
green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
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
|
||||||
|
|
||||||
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
||||||
until [[ "$l" =~ ^[12]$ ]]; do
|
until [[ "$l" =~ ^[12]$ ]]; do
|
||||||
read -p 'Select an option [1|2]: ' l
|
read -p 'Select an option [1|2]: ' l
|
||||||
|
@ -28,6 +41,6 @@ read -p 'Select an option [1|2]: ' l
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
$HOME/.local/bin/bsx/enabletor.sh
|
$HOME/.local/bin/bsx/enabletor.sh
|
||||||
|
|
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
red="echo -e -n \e[31;1m"
|
red="echo -e -n \e[31;1m"
|
||||||
green="echo -e -n \e[32;1m"
|
green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
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
|
||||||
|
|
||||||
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
||||||
until [[ "$l" =~ ^[12]$ ]]; do
|
until [[ "$l" =~ ^[12]$ ]]; do
|
||||||
read -p 'Select an option [1|2]: ' l
|
read -p 'Select an option [1|2]: ' l
|
||||||
|
@ -28,6 +41,6 @@ read -p 'Select an option [1|2]: ' l
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
$HOME/.local/bin/bsx/removecoin.sh
|
$HOME/.local/bin/bsx/removecoin.sh
|
||||||
|
|
18
bsx-update
18
bsx-update
|
@ -1,5 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
|
# 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
|
||||||
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
|
|
||||||
if [ -f /usr/local/bin/bsx/update.sh ]; then
|
if [ -f /usr/local/bin/bsx/update.sh ]; then
|
||||||
|
|
|
@ -1,10 +1,23 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
red="echo -e -n \e[31;1m"
|
red="echo -e -n \e[31;1m"
|
||||||
green="echo -e -n \e[32;1m"
|
green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
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
|
||||||
|
|
||||||
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
echo -e "BasicSwapDEX is currently:\n[1] Password protected\n[2] NOT password protected\n"
|
||||||
until [[ "$l" =~ ^[12]$ ]]; do
|
until [[ "$l" =~ ^[12]$ ]]; do
|
||||||
read -p 'Select an option [1|2]: ' l
|
read -p 'Select an option [1|2]: ' l
|
||||||
|
@ -28,6 +41,6 @@ read -p 'Select an option [1|2]: ' l
|
||||||
;;
|
;;
|
||||||
esac
|
esac
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
$HOME/.local/bin/bsx/upgradecoins.sh
|
$HOME/.local/bin/bsx/upgradecoins.sh
|
||||||
|
|
|
@ -42,17 +42,13 @@ enable_tor() {
|
||||||
if [[ "$particl_mnemonic" && "$monerod_addr" ]]; then
|
if [[ "$particl_mnemonic" && "$monerod_addr" ]]; then
|
||||||
# Restore seed
|
# Restore seed
|
||||||
PARTICL_MNEMONIC=$particl_mnemonic
|
PARTICL_MNEMONIC=$particl_mnemonic
|
||||||
basicswap-prepare --datadir=$SWAP_DATADIR --particl_mnemonic="$PARTICL_MNEMONIC"
|
|
||||||
# Add coins and use a remote monero node
|
|
||||||
XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port \
|
XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port \
|
||||||
basicswap-prepare --datadir=$SWAP_DATADIR --addcoin=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000
|
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000 --particl_mnemonic="$PARTICL_MNEMONIC"
|
||||||
enable_tor
|
enable_tor
|
||||||
elif [[ "$particl_mnemonic" ]]; then
|
elif [[ "$particl_mnemonic" ]]; then
|
||||||
# Restore seed
|
# Restore seed
|
||||||
PARTICL_MNEMONIC=$particl_mnemonic
|
PARTICL_MNEMONIC=$particl_mnemonic
|
||||||
basicswap-prepare --datadir=$SWAP_DATADIR --particl_mnemonic="$PARTICL_MNEMONIC"
|
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000 --particl_mnemonic="$PARTICL_MNEMONIC"
|
||||||
# Add coins using local nodes
|
|
||||||
basicswap-prepare --datadir=$SWAP_DATADIR --addcoin=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000
|
|
||||||
enable_tor
|
enable_tor
|
||||||
elif [[ "$monerod_addr" ]]; then
|
elif [[ "$monerod_addr" ]]; then
|
||||||
# Setup new install and use a remote monero node
|
# Setup new install and use a remote monero node
|
||||||
|
|
|
@ -3,7 +3,7 @@ cd $SWAP_DATADIR/basicswap
|
||||||
|
|
||||||
# Download updated scripts
|
# Download updated scripts
|
||||||
echo "Updating basicswap-bash scripts" && sleep 1
|
echo "Updating basicswap-bash scripts" && sleep 1
|
||||||
git clone https://github.com/nahuhh/basicswap-bash -b dev
|
git clone https://github.com/nahuhh/basicswap-bash
|
||||||
cd basicswap-bash
|
cd basicswap-bash
|
||||||
|
|
||||||
# Move scripts
|
# Move scripts
|
||||||
|
|
24
install.sh
24
install.sh
|
@ -1,10 +1,23 @@
|
||||||
#/bin/bash
|
#/bin/bash
|
||||||
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
|
|
||||||
# Colors
|
# Colors
|
||||||
red="echo -e -n \e[31;1m"
|
red="echo -e -n \e[31;1m"
|
||||||
green="echo -e -n \e[32;1m"
|
green="echo -e -n \e[32;1m"
|
||||||
nocolor="echo -e -n \e[0m"
|
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 already installed.\n"; $nocolor
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
# Title Bar
|
# Title Bar
|
||||||
$green "\n"
|
$green "\n"
|
||||||
title="BasicSwapDEX Installer"
|
title="BasicSwapDEX Installer"
|
||||||
|
@ -169,19 +182,24 @@ if ! [[ $trasherdk ]]; then
|
||||||
mkdir -p $HOME/.local/bin
|
mkdir -p $HOME/.local/bin
|
||||||
fi
|
fi
|
||||||
# Move scripts to .local/bin
|
# Move scripts to .local/bin
|
||||||
if [ -d $HOME/.local/bin/bsx ]; then
|
if [[ -d $HOME/.local/bin/bsx ]]; then
|
||||||
rm -r $HOME/.local/bin/bsx* $HOME/.local/bin/basicswap-bash
|
rm -r $HOME/.local/bin/bsx* $HOME/.local/bin/basicswap-bash
|
||||||
fi
|
fi
|
||||||
mv -f -t $HOME/.local/bin/ basicswap-bash bsx*
|
mv -f -t $HOME/.local/bin/ basicswap-bash bsx*
|
||||||
# Enable .profile detection on XFCE
|
# Enable .profile detection on XFCE
|
||||||
xfce_check=$(echo $XDG_CURRENT_DESKTOP | grep XFCE)
|
xfce_check=$(echo $XDG_CURRENT_DESKTOP | grep XFCE)
|
||||||
|
if [[ $xfce_chek ]]; then
|
||||||
|
if [[ -f $HOME/.xsessionrc ]]; then
|
||||||
xsessionrc_check=$(cat ~/.xsessionrc | grep '. ~/.profile')
|
xsessionrc_check=$(cat ~/.xsessionrc | grep '. ~/.profile')
|
||||||
if [[ $xfce_chek ]] && [[ -z $xsessionrc_check ]]; then
|
if [[ -z $xsessionrc_check ]]; then
|
||||||
echo '. ~/.profile' | tee -a ~/.xsessionrc
|
echo '. ~/.profile' | tee -a ~/.xsessionrc
|
||||||
fi
|
fi
|
||||||
|
else
|
||||||
|
echo '. ~/.profile' | tee -a ~/.xsessionrc
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
## Make venv and set variables for install
|
## Make venv and set variables for install
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
|
||||||
export monerod_addr=$monerod_addr
|
export monerod_addr=$monerod_addr
|
||||||
export monerod_port=$monerod_port
|
export monerod_port=$monerod_port
|
||||||
export particl_mnemonic=$particl_mnemonic
|
export particl_mnemonic=$particl_mnemonic
|
||||||
|
|
Loading…
Reference in a new issue