From 96fad3fcddce9d640ac40520f4b544f83bb2dfda Mon Sep 17 00:00:00 2001 From: nahuhh <50635951+nahuhh@users.noreply.github.com> Date: Tue, 4 Jun 2024 20:12:58 -0500 Subject: [PATCH] support password protected installs --- bsx-addcoin | 29 +++++++++++++++++++++++++++++ bsx-disabletor | 29 +++++++++++++++++++++++++++++ bsx-enabletor | 29 +++++++++++++++++++++++++++++ bsx-removecoin | 29 +++++++++++++++++++++++++++++ bsx-upgrade-coins | 29 +++++++++++++++++++++++++++++ 5 files changed, 145 insertions(+) diff --git a/bsx-addcoin b/bsx-addcoin index de0201c..d542b0e 100755 --- a/bsx-addcoin +++ b/bsx-addcoin @@ -1,4 +1,33 @@ #!/bin/bash + +# Colors +red="echo -e -n \e[31;1m" +green="echo -e -n \e[32;1m" +nocolor="echo -e -n \e[0m" + +echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n" +until [[ "$l" =~ ^[12]$ ]]; do +read -p 'Select an option [1|2]: ' l + case $l in + 1) + until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do + read -sp 'Enter your BasicSwap password: ' pass1 + read -sp $'\nRe-enter your BasicSwap password: ' pass2 + if [[ $pass1 == $pass2 ]]; then + export WALLET_ENCRYPTION_PWD=$pass1 + else + $red"\nThe passwords entered don't match. Try again\n\n"; $nocolor + fi + done + ;; + 2) + $nocolor"\nProceeding without a password\n" + ;; + *) + $red"You must answer 1 or 2\n"; $nocolor + ;; + esac +done export SWAP_DATADIR=$HOME/coinswaps . $SWAP_DATADIR/venv/bin/activate && python -V /usr/local/bin/bsx/addcoin.sh diff --git a/bsx-disabletor b/bsx-disabletor index eb0cd6e..98ab0a7 100755 --- a/bsx-disabletor +++ b/bsx-disabletor @@ -1,4 +1,33 @@ #!/bin/bash + +# Colors +red="echo -e -n \e[31;1m" +green="echo -e -n \e[32;1m" +nocolor="echo -e -n \e[0m" + +echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n" +until [[ "$l" =~ ^[12]$ ]]; do +read -p 'Select an option [1|2]: ' l + case $l in + 1) + until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do + read -sp 'Enter your BasicSwap password: ' pass1 + read -sp $'\nRe-enter your BasicSwap password: ' pass2 + if [[ $pass1 == $pass2 ]]; then + export WALLET_ENCRYPTION_PWD=$pass1 + else + $red"\nThe passwords entered don't match. Try again\n\n"; $nocolor + fi + done + ;; + 2) + $nocolor"\nProceeding without a password\n" + ;; + *) + $red"You must answer 1 or 2\n"; $nocolor + ;; + esac +done export SWAP_DATADIR=$HOME/coinswaps . $SWAP_DATADIR/venv/bin/activate && python -V /usr/local/bin/bsx/disabletor.sh diff --git a/bsx-enabletor b/bsx-enabletor index 67b2012..9ab76b3 100755 --- a/bsx-enabletor +++ b/bsx-enabletor @@ -1,4 +1,33 @@ #!/bin/bash + +# Colors +red="echo -e -n \e[31;1m" +green="echo -e -n \e[32;1m" +nocolor="echo -e -n \e[0m" + +echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n" +until [[ "$l" =~ ^[12]$ ]]; do +read -p 'Select an option [1|2]: ' l + case $l in + 1) + until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do + read -sp 'Enter your BasicSwap password: ' pass1 + read -sp $'\nRe-enter your BasicSwap password: ' pass2 + if [[ $pass1 == $pass2 ]]; then + export WALLET_ENCRYPTION_PWD=$pass1 + else + $red"\nThe passwords entered don't match. Try again\n\n"; $nocolor + fi + done + ;; + 2) + $nocolor"\nProceeding without a password\n" + ;; + *) + $red"You must answer 1 or 2\n"; $nocolor + ;; + esac +done export SWAP_DATADIR=$HOME/coinswaps . $SWAP_DATADIR/venv/bin/activate && python -V /usr/local/bin/bsx/enabletor.sh diff --git a/bsx-removecoin b/bsx-removecoin index 674b41c..8dd9ddc 100755 --- a/bsx-removecoin +++ b/bsx-removecoin @@ -1,4 +1,33 @@ #!/bin/bash + +# Colors +red="echo -e -n \e[31;1m" +green="echo -e -n \e[32;1m" +nocolor="echo -e -n \e[0m" + +echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n" +until [[ "$l" =~ ^[12]$ ]]; do +read -p 'Select an option [1|2]: ' l + case $l in + 1) + until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do + read -sp 'Enter your BasicSwap password: ' pass1 + read -sp $'\nRe-enter your BasicSwap password: ' pass2 + if [[ $pass1 == $pass2 ]]; then + export WALLET_ENCRYPTION_PWD=$pass1 + else + $red"\nThe passwords entered don't match. Try again\n\n"; $nocolor + fi + done + ;; + 2) + $nocolor"\nProceeding without a password\n" + ;; + *) + $red"You must answer 1 or 2\n"; $nocolor + ;; + esac +done export SWAP_DATADIR=$HOME/coinswaps . $SWAP_DATADIR/venv/bin/activate && python -V /usr/local/bin/bsx/removecoin.sh diff --git a/bsx-upgrade-coins b/bsx-upgrade-coins index 3333b4c..eb11c6f 100755 --- a/bsx-upgrade-coins +++ b/bsx-upgrade-coins @@ -1,4 +1,33 @@ #!/bin/bash + +# Colors +red="echo -e -n \e[31;1m" +green="echo -e -n \e[32;1m" +nocolor="echo -e -n \e[0m" + +echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n" +until [[ "$l" =~ ^[12]$ ]]; do +read -p 'Select an option [1|2]: ' l + case $l in + 1) + until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do + read -sp 'Enter your BasicSwap password: ' pass1 + read -sp $'\nRe-enter your BasicSwap password: ' pass2 + if [[ $pass1 == $pass2 ]]; then + export WALLET_ENCRYPTION_PWD=$pass1 + else + $red"\nThe passwords entered don't match. Try again\n\n"; $nocolor + fi + done + ;; + 2) + $nocolor"\nProceeding without a password\n" + ;; + *) + $red"You must answer 1 or 2\n"; $nocolor + ;; + esac +done export SWAP_DATADIR=$HOME/coinswaps . $SWAP_DATADIR/venv/bin/activate && python -V /usr/local/bin/bsx/upgradecoins.sh