diff --git a/README.md b/README.md index 771bb6b..4cfcb66 100644 --- a/README.md +++ b/README.md @@ -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 ``` diff --git a/basicswap-bash b/basicswap-bash index d2157e0..2e35e84 100755 --- a/basicswap-bash +++ b/basicswap-bash @@ -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 diff --git a/bsx-addcoin b/bsx-addcoin index d542b0e..2465f1e 100755 --- a/bsx-addcoin +++ b/bsx-addcoin @@ -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 diff --git a/bsx-disabletor b/bsx-disabletor index 98ab0a7..ad66f06 100755 --- a/bsx-disabletor +++ b/bsx-disabletor @@ -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 diff --git a/bsx-enabletor b/bsx-enabletor index 9ab76b3..a12663d 100755 --- a/bsx-enabletor +++ b/bsx-enabletor @@ -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 diff --git a/bsx-removecoin b/bsx-removecoin index 8dd9ddc..932933f 100755 --- a/bsx-removecoin +++ b/bsx-removecoin @@ -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 diff --git a/bsx-update b/bsx-update index b33bb0f..b292024 100755 --- a/bsx-update +++ b/bsx-update @@ -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 diff --git a/bsx-upgrade-coins b/bsx-upgrade-coins index eb11c6f..0949c17 100755 --- a/bsx-upgrade-coins +++ b/bsx-upgrade-coins @@ -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 diff --git a/bsx/activate_venv.sh b/bsx/activate_venv.sh index 0ef6e55..f361fdb 100755 --- a/bsx/activate_venv.sh +++ b/bsx/activate_venv.sh @@ -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 diff --git a/bsx/enabletor.sh b/bsx/enabletor.sh index c652d59..781f89a 100755 --- a/bsx/enabletor.sh +++ b/bsx/enabletor.sh @@ -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 diff --git a/bsx/setup.sh b/bsx/setup.sh index 8cdd82d..80aa8fc 100755 --- a/bsx/setup.sh +++ b/bsx/setup.sh @@ -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 } diff --git a/bsx/tails_setup.sh b/bsx/tails_setup.sh index df8bc4d..f620ab8 100755 --- a/bsx/tails_setup.sh +++ b/bsx/tails_setup.sh @@ -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 } diff --git a/bsx/update.sh b/bsx/update.sh index 7f5b4bf..939b083 100755 --- a/bsx/update.sh +++ b/bsx/update.sh @@ -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 diff --git a/install.sh b/install.sh index 3355c94..99048a8 100755 --- a/install.sh +++ b/install.sh @@ -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