Skip to content

Commit 96fad3f

Browse files
committed
support password protected installs
1 parent d3b442b commit 96fad3f

File tree

5 files changed

+145
-0
lines changed

5 files changed

+145
-0
lines changed

bsx-addcoin

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
#!/bin/bash
2+
3+
# Colors
4+
red="echo -e -n \e[31;1m"
5+
green="echo -e -n \e[32;1m"
6+
nocolor="echo -e -n \e[0m"
7+
8+
echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n"
9+
until [[ "$l" =~ ^[12]$ ]]; do
10+
read -p 'Select an option [1|2]: ' l
11+
case $l in
12+
1)
13+
until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do
14+
read -sp 'Enter your BasicSwap password: ' pass1
15+
read -sp $'\nRe-enter your BasicSwap password: ' pass2
16+
if [[ $pass1 == $pass2 ]]; then
17+
export WALLET_ENCRYPTION_PWD=$pass1
18+
else
19+
$red"\nThe passwords entered don't match. Try again\n\n"; $nocolor
20+
fi
21+
done
22+
;;
23+
2)
24+
$nocolor"\nProceeding without a password\n"
25+
;;
26+
*)
27+
$red"You must answer 1 or 2\n"; $nocolor
28+
;;
29+
esac
30+
done
231
export SWAP_DATADIR=$HOME/coinswaps
332
. $SWAP_DATADIR/venv/bin/activate && python -V
433
/usr/local/bin/bsx/addcoin.sh

bsx-disabletor

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
#!/bin/bash
2+
3+
# Colors
4+
red="echo -e -n \e[31;1m"
5+
green="echo -e -n \e[32;1m"
6+
nocolor="echo -e -n \e[0m"
7+
8+
echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n"
9+
until [[ "$l" =~ ^[12]$ ]]; do
10+
read -p 'Select an option [1|2]: ' l
11+
case $l in
12+
1)
13+
until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do
14+
read -sp 'Enter your BasicSwap password: ' pass1
15+
read -sp $'\nRe-enter your BasicSwap password: ' pass2
16+
if [[ $pass1 == $pass2 ]]; then
17+
export WALLET_ENCRYPTION_PWD=$pass1
18+
else
19+
$red"\nThe passwords entered don't match. Try again\n\n"; $nocolor
20+
fi
21+
done
22+
;;
23+
2)
24+
$nocolor"\nProceeding without a password\n"
25+
;;
26+
*)
27+
$red"You must answer 1 or 2\n"; $nocolor
28+
;;
29+
esac
30+
done
231
export SWAP_DATADIR=$HOME/coinswaps
332
. $SWAP_DATADIR/venv/bin/activate && python -V
433
/usr/local/bin/bsx/disabletor.sh

bsx-enabletor

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
#!/bin/bash
2+
3+
# Colors
4+
red="echo -e -n \e[31;1m"
5+
green="echo -e -n \e[32;1m"
6+
nocolor="echo -e -n \e[0m"
7+
8+
echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n"
9+
until [[ "$l" =~ ^[12]$ ]]; do
10+
read -p 'Select an option [1|2]: ' l
11+
case $l in
12+
1)
13+
until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do
14+
read -sp 'Enter your BasicSwap password: ' pass1
15+
read -sp $'\nRe-enter your BasicSwap password: ' pass2
16+
if [[ $pass1 == $pass2 ]]; then
17+
export WALLET_ENCRYPTION_PWD=$pass1
18+
else
19+
$red"\nThe passwords entered don't match. Try again\n\n"; $nocolor
20+
fi
21+
done
22+
;;
23+
2)
24+
$nocolor"\nProceeding without a password\n"
25+
;;
26+
*)
27+
$red"You must answer 1 or 2\n"; $nocolor
28+
;;
29+
esac
30+
done
231
export SWAP_DATADIR=$HOME/coinswaps
332
. $SWAP_DATADIR/venv/bin/activate && python -V
433
/usr/local/bin/bsx/enabletor.sh

bsx-removecoin

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
#!/bin/bash
2+
3+
# Colors
4+
red="echo -e -n \e[31;1m"
5+
green="echo -e -n \e[32;1m"
6+
nocolor="echo -e -n \e[0m"
7+
8+
echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n"
9+
until [[ "$l" =~ ^[12]$ ]]; do
10+
read -p 'Select an option [1|2]: ' l
11+
case $l in
12+
1)
13+
until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do
14+
read -sp 'Enter your BasicSwap password: ' pass1
15+
read -sp $'\nRe-enter your BasicSwap password: ' pass2
16+
if [[ $pass1 == $pass2 ]]; then
17+
export WALLET_ENCRYPTION_PWD=$pass1
18+
else
19+
$red"\nThe passwords entered don't match. Try again\n\n"; $nocolor
20+
fi
21+
done
22+
;;
23+
2)
24+
$nocolor"\nProceeding without a password\n"
25+
;;
26+
*)
27+
$red"You must answer 1 or 2\n"; $nocolor
28+
;;
29+
esac
30+
done
231
export SWAP_DATADIR=$HOME/coinswaps
332
. $SWAP_DATADIR/venv/bin/activate && python -V
433
/usr/local/bin/bsx/removecoin.sh

bsx-upgrade-coins

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,33 @@
11
#!/bin/bash
2+
3+
# Colors
4+
red="echo -e -n \e[31;1m"
5+
green="echo -e -n \e[32;1m"
6+
nocolor="echo -e -n \e[0m"
7+
8+
echo -e "My BasicSwapDEX is:\n[1] Password protected\n[2] NOT password protected\n"
9+
until [[ "$l" =~ ^[12]$ ]]; do
10+
read -p 'Select an option [1|2]: ' l
11+
case $l in
12+
1)
13+
until [[ $pass1 ]] && [[ $pass1 == $pass2 ]]; do
14+
read -sp 'Enter your BasicSwap password: ' pass1
15+
read -sp $'\nRe-enter your BasicSwap password: ' pass2
16+
if [[ $pass1 == $pass2 ]]; then
17+
export WALLET_ENCRYPTION_PWD=$pass1
18+
else
19+
$red"\nThe passwords entered don't match. Try again\n\n"; $nocolor
20+
fi
21+
done
22+
;;
23+
2)
24+
$nocolor"\nProceeding without a password\n"
25+
;;
26+
*)
27+
$red"You must answer 1 or 2\n"; $nocolor
28+
;;
29+
esac
30+
done
231
export SWAP_DATADIR=$HOME/coinswaps
332
. $SWAP_DATADIR/venv/bin/activate && python -V
433
/usr/local/bin/bsx/upgradecoins.sh

0 commit comments

Comments
 (0)