mirror of
https://github.com/nahuhh/basicswap-bash.git
synced 2024-12-22 19:49:21 +00:00
Compare commits
10 commits
feaa77b5ed
...
387dfec6e7
Author | SHA1 | Date | |
---|---|---|---|
|
387dfec6e7 | ||
|
61b8618e90 | ||
|
318cdf7c6a | ||
|
1a85e5b6fe | ||
|
40fecdc214 | ||
|
2eb3465704 | ||
|
41ae85ee08 | ||
|
a4720f834b | ||
|
5c491184ff | ||
|
e8f3a7d964 |
12 changed files with 183 additions and 40 deletions
|
@ -4,14 +4,14 @@ BasicSwapDEX on Windows(WSL)/Debian/Ubuntu/Arch/Fedora
|
||||||
|
|
||||||
### New Installation
|
### New Installation
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/nahuhh/basicswap-bash
|
git clone https://github.com/nahuhh/basicswap-bash -b dev
|
||||||
cd basicswap-bash && ./install.sh
|
cd basicswap-bash && ./install.sh
|
||||||
cd .. && rm -rf basicswap-bash
|
cd .. && rm -rf basicswap-bash
|
||||||
```
|
```
|
||||||
### Update scripts from older versions
|
### Update scripts from older versions
|
||||||
``` bash
|
``` bash
|
||||||
cd ~/coinswaps/basicswap
|
cd ~/coinswaps/basicswap
|
||||||
git clone https://github.com/nahuhh/basicswap-bash
|
git clone https://github.com/nahuhh/basicswap-bash -b dev
|
||||||
cd basicswap-bash
|
cd basicswap-bash
|
||||||
mkdir -p $HOME/.local/bin
|
mkdir -p $HOME/.local/bin
|
||||||
rm -r $HOME/.local/bin/bsx
|
rm -r $HOME/.local/bin/bsx
|
||||||
|
|
|
@ -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
|
||||||
|
|
20
bsx/setup.sh
20
bsx/setup.sh
|
@ -7,17 +7,20 @@ nocolor="echo -e -n \e[0m"
|
||||||
|
|
||||||
## Download & Install coincurve stuff
|
## Download & Install coincurve stuff
|
||||||
cd $SWAP_DATADIR
|
cd $SWAP_DATADIR
|
||||||
wget -O coincurve-anonswap.zip https://github.com/tecnovert/coincurve/archive/refs/tags/anonswap_v0.2.zip
|
git clone https://github.com/basicswap/coincurve -b basicswap_v0.2 coincurve-basicswap
|
||||||
unzip -d coincurve-anonswap coincurve-anonswap.zip
|
cd $SWAP_DATADIR/coincurve-basicswap
|
||||||
mv -f ./coincurve-anonswap/*/{.,}* ./coincurve-anonswap || true
|
|
||||||
cd $SWAP_DATADIR/coincurve-anonswap
|
|
||||||
$SWAP_DATADIR/venv/bin/pip install .
|
$SWAP_DATADIR/venv/bin/pip install .
|
||||||
|
|
||||||
## Clone basicswap git
|
## Clone basicswap git
|
||||||
cd $SWAP_DATADIR
|
cd $SWAP_DATADIR
|
||||||
git clone https://github.com/basicswap/basicswap
|
git clone https://github.com/basicswap/basicswap -b dev
|
||||||
cd $SWAP_DATADIR/basicswap
|
cd $SWAP_DATADIR/basicswap
|
||||||
|
## Macos
|
||||||
|
if [[ $MACOS ]]; then
|
||||||
|
$SWAP_DATADIR/venv/bin/pip install certifi
|
||||||
|
fi
|
||||||
## Install basicswap
|
## Install basicswap
|
||||||
|
$SWAP_DATADIR/venv/bin/pip install wheel
|
||||||
$SWAP_DATADIR/venv/bin/pip install .
|
$SWAP_DATADIR/venv/bin/pip install .
|
||||||
|
|
||||||
## Decide a source for Monero's restore height
|
## Decide a source for Monero's restore height
|
||||||
|
@ -42,7 +45,7 @@ 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
|
||||||
XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port \
|
XMR_RPC_HOST=$monerod_addr XMR_RPC_PORT=$monerod_port \
|
||||||
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000 --particl_mnemonic="$PARTICL_MNEMONIC"
|
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
|
||||||
|
@ -52,7 +55,7 @@ elif [[ "$particl_mnemonic" ]]; then
|
||||||
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
|
||||||
XMR_RPC_HOST=$monerod_addr BASE_XMR_RPC_PORT=$monerod_port \
|
XMR_RPC_HOST=$monerod_addr XMR_RPC_PORT=$monerod_port \
|
||||||
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000
|
basicswap-prepare --datadir=$SWAP_DATADIR --withcoins=monero,wownero --xmrrestoreheight=$CURRENT_XMR_HEIGHT --wowrestoreheight=600000
|
||||||
$red"\n\nMake note of your seed above\n"; $nocolor
|
$red"\n\nMake note of your seed above\n"; $nocolor
|
||||||
enable_tor
|
enable_tor
|
||||||
|
@ -63,4 +66,5 @@ else
|
||||||
enable_tor
|
enable_tor
|
||||||
fi
|
fi
|
||||||
|
|
||||||
$green"Install complete.\n\nUse 'basicswap-bash' to run, 'bsx-update' to update, and 'bsx-addcoin' to add a coin\n"; $nocolor
|
$green"Install complete.\n\nUse 'basicswap-bash' to run, 'bsx-update' to update, and 'bsx-addcoin' to add a coin\n\nYou'll need to open a new login shell (a new terminal window) for the start scripts to be recognized.\n";$nocolor
|
||||||
|
$red"XFCE will require you to logout / login";$nocolor
|
||||||
|
|
|
@ -1,9 +1,10 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
COINCURVE=0.2
|
||||||
cd $SWAP_DATADIR/basicswap
|
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
|
git clone https://github.com/nahuhh/basicswap-bash -b dev
|
||||||
cd basicswap-bash
|
cd basicswap-bash
|
||||||
|
|
||||||
# Move scripts
|
# Move scripts
|
||||||
|
@ -17,6 +18,18 @@ echo "Updating BasicSwapDEX" && sleep 1
|
||||||
# Delete dangling build folder. Same as --no-cache for docker
|
# Delete dangling build folder. Same as --no-cache for docker
|
||||||
rm -rf $SWAP_DATADIR/basicswap/build
|
rm -rf $SWAP_DATADIR/basicswap/build
|
||||||
|
|
||||||
|
# Coincurve
|
||||||
|
cd $SWAP_DATADIR
|
||||||
|
if [[ -d coincurve-basicswap ]]; then
|
||||||
|
cd coincurve-basicswap
|
||||||
|
git pull
|
||||||
|
git checkout basicswap_v$COINCURVE
|
||||||
|
else
|
||||||
|
git clone https://github.com/basicswap/coincurve -b basicswap_v$COINCURVE coincurve-basicswap && cd $_
|
||||||
|
fi
|
||||||
|
$SWAP_DATADIR/venv/bin/pip install .
|
||||||
|
|
||||||
|
# BasicSwap
|
||||||
# Switch to new repo: basicswap/basicswap
|
# Switch to new repo: basicswap/basicswap
|
||||||
cd $SWAP_DATADIR/basicswap
|
cd $SWAP_DATADIR/basicswap
|
||||||
git remote set-url origin https://github.com/basicswap/basicswap
|
git remote set-url origin https://github.com/basicswap/basicswap
|
||||||
|
@ -30,4 +43,4 @@ $SWAP_DATADIR/venv/bin/pip install .
|
||||||
$HOME/.local/bin/bsx/auto_coinupd8.sh
|
$HOME/.local/bin/bsx/auto_coinupd8.sh
|
||||||
|
|
||||||
# Cleanup
|
# Cleanup
|
||||||
rm -rf basicswap-bash core_versions
|
rm -rf basicswap-bash
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
Bitcoin Core version v26.0.0
|
Bitcoin Core version v26.0.0
|
||||||
dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64)
|
dcrd version 1.8.1+release (Go version go1.21.1 linux/amd64)
|
||||||
Dash Core version v20.0.2
|
Dash Core version v21.1.0
|
||||||
Firo Core Daemon version v0.14.14.0-ge0c423805
|
Firo Core Daemon version v0.14.14.0-ge0c423805
|
||||||
Litecoin Core version v0.21.3
|
Litecoin Core version v0.21.3
|
||||||
Particl Core version v23.2.7.0
|
Particl Core version v23.2.7.0
|
||||||
|
|
69
install.sh
69
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"
|
||||||
|
@ -50,9 +63,16 @@ detect_os_arch() {
|
||||||
UPDATE="sudo pacman -Syu"
|
UPDATE="sudo pacman -Syu"
|
||||||
DEPENDENCY="python-pipenv gnupg pkgconf base-devel"
|
DEPENDENCY="python-pipenv gnupg pkgconf base-devel"
|
||||||
$green"\nDetected Arch Linux\n";$nocolor
|
$green"\nDetected Arch Linux\n";$nocolor
|
||||||
elif type -P brew > /dev/null; then
|
elif [[ $(uname -s) = "Darwin" ]]; then
|
||||||
# MacOS
|
# MacOS
|
||||||
INSTALL="brew install"
|
export MACOS=1
|
||||||
|
if type -P brew > /dev/null; then
|
||||||
|
$green"Homebrew is installed\n";$nc
|
||||||
|
INSTALL="brew install"
|
||||||
|
else
|
||||||
|
$green"Installing Homebrew\n";$nc
|
||||||
|
INSTALL="curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh | /bin/bash && brew install"
|
||||||
|
fi
|
||||||
DEPENDENCY="python gnupg pkg-config"
|
DEPENDENCY="python gnupg pkg-config"
|
||||||
$green"\nDetected MacOS\n";$nocolor
|
$green"\nDetected MacOS\n";$nocolor
|
||||||
else
|
else
|
||||||
|
@ -61,14 +81,13 @@ detect_os_arch() {
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
detect_os_arch
|
detect_os_arch
|
||||||
|
|
||||||
## Update & Install dependencies
|
## Update & Install dependencies
|
||||||
echo -e "\n\nInstalling dependencies\nPress CTRL-C at password prompt(s) to skip. If skipped, you must install the dependencies manually before proceeding"
|
echo -e "\n\nInstalling dependencies\nPress CTRL-C at password prompt(s) to skip. If skipped, you must install the dependencies manually before proceeding"
|
||||||
$green"$UPDATE\n$INSTALL $DEPENDENCY git curl wget unzip automake libtool jq\n"; $nocolor
|
$green"$UPDATE\n$INSTALL $DEPENDENCY curl automake libtool jq\n"; $nocolor
|
||||||
$UPDATE
|
$UPDATE
|
||||||
$INSTALL $DEPENDENCY git curl wget unzip automake libtool jq
|
$INSTALL $DEPENDENCY curl automake libtool jq
|
||||||
|
|
||||||
# Enable tor
|
# Enable tor
|
||||||
echo -e "\n\n[1] Tor ON (requires sudo)\n[2] Tor OFF\n"
|
echo -e "\n\n[1] Tor ON (requires sudo)\n[2] Tor OFF\n"
|
||||||
|
@ -164,31 +183,39 @@ echo -e "\n\nInstalling BasicSwapDEX"
|
||||||
read -p 'Press Enter to continue, or CTRL-C to exit.'
|
read -p 'Press Enter to continue, or CTRL-C to exit.'
|
||||||
|
|
||||||
# Quest to make trasher happy
|
# Quest to make trasher happy
|
||||||
trasherdk=$(echo $PATH | grep $USER/.local/bin)
|
addpath='PATH="$HOME/.local/bin:$PATH"'
|
||||||
|
trasherdk=$(echo $PATH | grep .local/bin)
|
||||||
if ! [[ $trasherdk ]]; then
|
if ! [[ $trasherdk ]]; then
|
||||||
mkdir -p $HOME/.local/bin
|
mkdir -p $HOME/.local/bin
|
||||||
fi
|
|
||||||
# Move scripts to .local/bin
|
# Bash
|
||||||
if [ -d $HOME/.local/bin/bsx ]; then
|
if [[ -f $HOME/.bashrc ]]; then
|
||||||
rm -r $HOME/.local/bin/bsx* $HOME/.local/bin/basicswap-bash
|
echo "export $addpath" | tee -a $HOME/.bashrc
|
||||||
fi
|
fi
|
||||||
mv -f -t $HOME/.local/bin/ basicswap-bash bsx*
|
# Zsh
|
||||||
# Enable .profile detection on XFCE
|
if [[ -f $HOME/.zshrc ]]; then
|
||||||
xfce_check=$(echo $XDG_CURRENT_DESKTOP | grep XFCE)
|
echo "export $addpath" | tee -a $HOME/.zshrc
|
||||||
xsessionrc_check=$(cat ~/.xsessionrc | grep '. ~/.profile')
|
fi
|
||||||
if [[ $xfce_chek ]] && [[ -z $xsessionrc_check ]]; then
|
# xfce4
|
||||||
echo '. ~/.profile' | tee -a ~/.xsessionrc
|
if [[ -f $HOME/.xsessionrc ]]; then
|
||||||
|
echo "export $addpath" | tee -a $HOME/.xsessionrc
|
||||||
|
fi
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Move scripts to .local/bin
|
||||||
|
if [[ -d $HOME/.local/bin/bsx ]]; then
|
||||||
|
rm -r $HOME/.local/bin/bsx* $HOME/.local/bin/basicswap-bash
|
||||||
|
fi
|
||||||
|
mv -f -t $HOME/.local/bin/ basicswap-bash bsx*
|
||||||
|
|
||||||
## 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
|
||||||
export xmrrestoreheight=$xmrrestoreheight
|
export xmrrestoreheight=$xmrrestoreheight
|
||||||
export tor_on=$tor_on
|
export tor_on=$tor_on
|
||||||
export TAILS=$TAILS
|
export TAILS=$TAILS
|
||||||
mkdir -p "$SWAP_DATADIR/venv"
|
|
||||||
python -m venv "$SWAP_DATADIR/venv"
|
python -m venv "$SWAP_DATADIR/venv"
|
||||||
## Activate venv
|
## Activate venv
|
||||||
$HOME/.local/bin/bsx/activate_venv.sh
|
$HOME/.local/bin/bsx/activate_venv.sh
|
||||||
|
|
Loading…
Reference in a new issue