mirror of
https://github.com/nahuhh/basicswap-bash.git
synced 2024-12-22 11:39:21 +00:00
use $HOME/.local/bin
This commit is contained in:
parent
96fad3fcdd
commit
07cc24b204
14 changed files with 45 additions and 25 deletions
19
README.md
19
README.md
|
@ -1,15 +1,24 @@
|
||||||
# basicswap-bash
|
# basicswap-bash
|
||||||
A BasicSwapDEX bash installer for Debian/Ubuntu/Arch/Fedora
|
A suite of bash scripts to install and manage
|
||||||
User account must have sudo privileges
|
BasicSwapDEX on Windows(WSL)/Debian/Ubuntu/Arch/Fedora
|
||||||
|
|
||||||
### Installation
|
|
||||||
|
|
||||||
|
### New Installation
|
||||||
```bash
|
```bash
|
||||||
git clone https://github.com/nahuhh/basicswap-bash -b dev
|
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
|
||||||
|
``` 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
|
### Running BasicSwapDEX
|
||||||
```
|
```
|
||||||
|
|
|
@ -2,4 +2,4 @@
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
python3 -m venv "$SWAP_DATADIR/venv"
|
python3 -m venv "$SWAP_DATADIR/venv"
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/startup.sh
|
$HOME/.local/bin/bsx/startup.sh
|
||||||
|
|
|
@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/addcoin.sh
|
$HOME/.local/bin/bsx/addcoin.sh
|
||||||
|
|
|
@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/disabletor.sh
|
$HOME/.local/bin/bsx/disabletor.sh
|
||||||
|
|
|
@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/enabletor.sh
|
$HOME/.local/bin/bsx/enabletor.sh
|
||||||
|
|
|
@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/removecoin.sh
|
$HOME/.local/bin/bsx/removecoin.sh
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/update.sh
|
$HOME/.local/bin/bsx/update.sh
|
||||||
|
|
|
@ -30,4 +30,4 @@ read -p 'Select an option [1|2]: ' l
|
||||||
done
|
done
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
/usr/local/bin/bsx/upgradecoins.sh
|
$HOME/.local/bin/bsx/upgradecoins.sh
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
. $SWAP_DATADIR/venv/bin/activate && python -V
|
. $SWAP_DATADIR/venv/bin/activate && python -V
|
||||||
if [[ $TAILS ]]; then
|
if [[ $TAILS ]]; then
|
||||||
/usr/local/bin/bsx/tails_setup.sh
|
$HOME/.local/bin/bsx/tails_setup.sh
|
||||||
else
|
else
|
||||||
/usr/local/bin/bsx/setup.sh
|
$HOME/.local/bin/bsx/setup.sh
|
||||||
fi
|
fi
|
||||||
|
|
|
@ -47,7 +47,7 @@ else
|
||||||
$INSTALL tor
|
$INSTALL tor
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Create HashesControlPassword
|
# Create HashedControlPassword
|
||||||
echo -e "In the next step you'll choose a password. NOTE: It will be saved in PLAIN TEXT."
|
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
|
read -p "Enter a (new) tor control password [example: 123123] " torcontrolpass
|
||||||
# Edit /etc/tor/torrc
|
# Edit /etc/tor/torrc
|
||||||
|
|
|
@ -34,7 +34,7 @@ fi
|
||||||
# Use Tor if we want
|
# Use Tor if we want
|
||||||
enable_tor() {
|
enable_tor() {
|
||||||
if [[ "$tor_on" = 1 ]]; then
|
if [[ "$tor_on" = 1 ]]; then
|
||||||
/usr/local/bin/bsx-enabletor
|
$HOME/.local/bin/bsx-enabletor
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -34,7 +34,7 @@ fi
|
||||||
# Use Tor if we want
|
# Use Tor if we want
|
||||||
enable_tor() {
|
enable_tor() {
|
||||||
if [[ "$tor_on" = 1 ]]; then
|
if [[ "$tor_on" = 1 ]]; then
|
||||||
/usr/local/bin/bsx-enabletor
|
$HOME/.local/bin/bsx-enabletor
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -6,8 +6,8 @@ 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 -b dev
|
||||||
cd basicswap-bash
|
cd basicswap-bash
|
||||||
# Move scripts
|
# Move scripts
|
||||||
sudo rm -rf /usr/local/bin/bsx
|
rm -rf $HOME/.local/bin/bsx
|
||||||
sudo mv -f basic* bsx* /usr/local/bin/
|
mv -f basic* bsx* $HOME/.local/bin/
|
||||||
# Cleanup install
|
# Cleanup install
|
||||||
cd ..
|
cd ..
|
||||||
rm -rf basicswap-bash
|
rm -rf basicswap-bash
|
||||||
|
|
23
install.sh
23
install.sh
|
@ -64,7 +64,7 @@ detect_os_arch() {
|
||||||
detect_os_arch
|
detect_os_arch
|
||||||
|
|
||||||
# Enable tor
|
# 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
|
until [[ "$tor_on" =~ ^[12]$ ]]; do
|
||||||
read -p 'Select an option: [1|2] ' tor_on
|
read -p 'Select an option: [1|2] ' tor_on
|
||||||
case $tor_on in
|
case $tor_on in
|
||||||
|
@ -153,14 +153,25 @@ read -p 'Select an option [1|2]: ' l
|
||||||
done
|
done
|
||||||
|
|
||||||
## Begin Install
|
## Begin Install
|
||||||
echo -e "\n\nInstalling dependencies"
|
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.'
|
||||||
## 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"
|
||||||
|
$green"$UPDATE\n$INSTALL $DEPENDENCY git wget unzip automake libtool jq\n"; $nocolor
|
||||||
$UPDATE
|
$UPDATE
|
||||||
$INSTALL $DEPENDENCY git wget unzip automake libtool jq
|
$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
|
# Quest to make trasher happy
|
||||||
sudo mv -f -t /usr/local/bin/ basicswap-bash bsx*
|
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
|
## Make venv and set variables for install
|
||||||
export SWAP_DATADIR=$HOME/coinswaps
|
export SWAP_DATADIR=$HOME/coinswaps
|
||||||
export monerod_addr=$monerod_addr
|
export monerod_addr=$monerod_addr
|
||||||
|
@ -172,4 +183,4 @@ export TAILS=$TAILS
|
||||||
mkdir -p "$SWAP_DATADIR/venv"
|
mkdir -p "$SWAP_DATADIR/venv"
|
||||||
python -m venv "$SWAP_DATADIR/venv"
|
python -m venv "$SWAP_DATADIR/venv"
|
||||||
## Activate venv
|
## Activate venv
|
||||||
/usr/local/bin/bsx/activate_venv.sh
|
$HOME/.local/bin/bsx/activate_venv.sh
|
||||||
|
|
Loading…
Reference in a new issue