forked from shihaamabr/bml-cli
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsavepass.sh
More file actions
37 lines (35 loc) · 1019 Bytes
/
savepass.sh
File metadata and controls
37 lines (35 loc) · 1019 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
if [ ! -f $CREDENTIALS ]
then
if [ "$LOGIN" = "0" ]
then
read -p 'Do you want to save login? [y/N] ' SAVE_LOGIN
if [ "$SAVE_LOGIN" = "Y" ] || [ "$SAVE_LOGIN" = "y" ]
then
read -s -p 'Enter Pin: ' PIN
echo ""
read -s -p 'Repeat Pin: ' REPEAT_PIN
if [ "$PIN" = "$REPEAT_PIN" ]
then
echo ""
echo "Your credentials are ${lightgreen}encrypted${reset} and saved in $CREDENTIALS"
BML_USERNAME=$(echo "${BML_USERNAME}" | openssl enc -e -des3 -base64 -pass pass:${PIN} -pbkdf2)
BML_PASSWORD=$(echo "${BML_PASSWORD}" | openssl enc -e -des3 -base64 -pass pass:${PIN} -pbkdf2)
echo "BML_USERNAME='${BML_USERNAME}'" > $CREDENTIALS
echo "BML_PASSWORD='${BML_PASSWORD}'" >> $CREDENTIALS
else
echo ""
echo "${red}Pin do not match${reset}"
source savepass.sh
fi
else
:
fi
else
source readpass.sh
fi
else
:
fi
BML_USERNAME=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5)
BML_PASSWORD=$(head /dev/urandom | tr -dc A-Za-z0-9 | head -c 5)
source welcome.sh