use $HOME/.local/bin

This commit is contained in:
nahuhh 2024-06-05 13:36:36 -05:00
parent 96fad3fcdd
commit 852eda5894
14 changed files with 45 additions and 25 deletions

View file

@ -1,15 +1,24 @@
# basicswap-bash
A BasicSwapDEX bash installer for Debian/Ubuntu/Arch/Fedora
User account must have sudo privileges
### Installation
A suite of bash scripts to install and manage
BasicSwapDEX on Windows(WSL)/Debian/Ubuntu/Arch/Fedora
### New Installation
```bash
git clone https://github.com/nahuhh/basicswap-bash -b dev
cd basicswap-bash && ./install.sh
cd .. && rm -rf basicswap-bash
```
### Update scripts from older versions
``` bash
cd ~/coinswaps/basicswap
git clone https://github.com/nahuhh/basicswap-bash -b dev
cd basicswap-bash
mkdir -p $HOME/.local/bin
rm -r $HOME/.local/bin/bsx
mv -f basic* bsx* $HOME/.local/bin/
cd .. && rm -rf basicswap-bash
bsx-update
```
### Running BasicSwapDEX
```

View file

@ -2,4 +2,4 @@
export SWAP_DATADIR=$HOME/coinswaps
python3 -m venv "$SWAP_DATADIR/venv"
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/startup.sh
$HOME/.local/bin/bsx/startup.sh

View file

@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
done
export SWAP_DATADIR=$HOME/coinswaps
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/addcoin.sh
$HOME/.local/bin/bsx/addcoin.sh

View file

@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
done
export SWAP_DATADIR=$HOME/coinswaps
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/disabletor.sh
$HOME/.local/bin/bsx/disabletor.sh

View file

@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
done
export SWAP_DATADIR=$HOME/coinswaps
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/enabletor.sh
$HOME/.local/bin/bsx/enabletor.sh

View file

@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
done
export SWAP_DATADIR=$HOME/coinswaps
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/removecoin.sh
$HOME/.local/bin/bsx/removecoin.sh

View file

@ -1,4 +1,4 @@
#!/bin/bash
export SWAP_DATADIR=$HOME/coinswaps
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/update.sh
$HOME/.local/bin/bsx/update.sh

View file

@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
done
export SWAP_DATADIR=$HOME/coinswaps
. $SWAP_DATADIR/venv/bin/activate && python -V
/usr/local/bin/bsx/upgradecoins.sh
$HOME/.local/bin/bsx/upgradecoins.sh

View file

@ -1,7 +1,7 @@
#!/bin/bash
. $SWAP_DATADIR/venv/bin/activate && python -V
if [[ $TAILS ]]; then
/usr/local/bin/bsx/tails_setup.sh
$HOME/.local/bin/bsx/tails_setup.sh
else
/usr/local/bin/bsx/setup.sh
$HOME/.local/bin/bsx/setup.sh
fi

View file

@ -47,7 +47,7 @@ else
$INSTALL tor
fi
# Create HashesControlPassword
# Create HashedControlPassword
echo -e "In the next step you'll choose a password. NOTE: It will be saved in PLAIN TEXT."
read -p "Enter a (new) tor control password [example: 123123] " torcontrolpass
# Edit /etc/tor/torrc

View file

@ -34,7 +34,7 @@ fi
# Use Tor if we want
enable_tor() {
if [[ "$tor_on" = 1 ]]; then
/usr/local/bin/bsx-enabletor
$HOME/.local/bin/bsx-enabletor
fi
}

View file

@ -34,7 +34,7 @@ fi
# Use Tor if we want
enable_tor() {
if [[ "$tor_on" = 1 ]]; then
/usr/local/bin/bsx-enabletor
$HOME/.local/bin/bsx-enabletor
fi
}

View file

@ -6,8 +6,8 @@ echo "Updating basicswap-bash scripts" && sleep 1
git clone https://github.com/nahuhh/basicswap-bash -b dev
cd basicswap-bash
# Move scripts
sudo rm -rf /usr/local/bin/bsx
sudo mv -f basic* bsx* /usr/local/bin/
sudo rm -rf $HOME/.local/bin/bsx
sudo mv -f basic* bsx* $HOME/.local/bin/
# Cleanup install
cd ..
rm -rf basicswap-bash

View file

@ -64,7 +64,7 @@ detect_os_arch() {
detect_os_arch
# Enable tor
echo -e "\n\n[1] Tor ON\n[2] Tor OFF\n"
echo -e "\n\n[1] Tor ON (requires sudo)\n[2] Tor OFF\n"
until [[ "$tor_on" =~ ^[12]$ ]]; do
read -p 'Select an option: [1|2] ' tor_on
case $tor_on in
@ -153,14 +153,25 @@ read -p 'Select an option [1|2]: ' l
done
## Begin Install
echo -e "\n\nInstalling dependencies"
echo -e "\n\nInstalling BasicSwapDEX"
read -p 'Press Enter to continue, or CTRL-C to exit.'
## 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"
$green"$UPDATE\n$INSTALL $DEPENDENCY git wget unzip automake libtool jq\n"; $nocolor
$UPDATE
$INSTALL $DEPENDENCY git wget unzip automake libtool jq
# Move scripts to /usr/local/bin
sudo rm -r /usr/local/bin/bsx* /usr/local/bin/basicswap-bash
sudo mv -f -t /usr/local/bin/ basicswap-bash bsx*
# Quest to make trasher happy
trasherdk=$(echo $PATH | grep $USER/.local/bin)
if ! [[ $trasherdk ]]; then
mkdir -p $HOME/.local/bin
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
export SWAP_DATADIR=$HOME/coinswaps
export monerod_addr=$monerod_addr
@ -172,4 +183,4 @@ export TAILS=$TAILS
mkdir -p "$SWAP_DATADIR/venv"
python -m venv "$SWAP_DATADIR/venv"
## Activate venv
/usr/local/bin/bsx/activate_venv.sh
$HOME/.local/bin/bsx/activate_venv.sh