Skip to content

Commit 53c37e1

Browse files
authored
Merge pull request #8 from mateuscomh/fix/merge
Fix commit
2 parents 7e585cc + 00c2972 commit 53c37e1

1 file changed

Lines changed: 9 additions & 18 deletions

File tree

shellPass.sh

Lines changed: 9 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@
1212
export LANG=C
1313
VERSION='2.4 by Matheus Martins'
1414
USAGE="Program to generate on shell passwords whith alpanum on terminal
15-
1615
░▒█▀▀▀█░█░░░░█▀▀░█░░█░░▄▀▀▄░█▀▀▄░█▀▀░█▀▀
1716
░░▀▀▀▄▄░█▀▀█░█▀▀░█░░█░░█▄▄█░█▄▄█░▀▀▄░▀▀▄
1817
░▒█▄▄▄█░▀░░▀░▀▀▀░▀▀░▀▀░█░░░░▀░░▀░▀▀▀░▀▀▀ "
@@ -27,7 +26,7 @@ _gerarsenha(){
2726
if [ -z "$MAX" ] || [ "$MAX" -eq 0 ]; then
2827
clear
2928
echo -e "$USAGE \n"
30-
echo -e "${VERDE} Enter the QUANTITY of characters for the password: ${FECHA}"
29+
echo -e "${VERDE} Enter the QUANTITY of characters for the password or [Q] to quit: ${FECHA}"
3130
read -r MAX
3231
fi
3332

@@ -47,17 +46,6 @@ case $MAX in
4746
${AMARELO} 3 - Password with LeTtErS, numb3rs and Speci@l Ch@r@ct&rs ${FECHA}";
4847
read -sn 1 TIPO;
4948

50-
case "$TIPO" in
51-
''|*[!0-9]*)
52-
echo -e "${VERMELHO} Enter only numbers referring to the TYPE of the password ${FECHA}"
53-
return 1
54-
;;
55-
1)
56-
PASS=$(cat /dev/urandom LC_ALL=C | tr -dc '0-9' | head -c "$MAX")
57-
command -v xclip > /dev/null && echo -n "$PASS" | xclip -sel copy || echo -n "$PASS" | pbcopy 2> /dev/null
58-
echo -e "${VERDE}$PASS${FECHA}"
59-
;;
60-
2)
6149
case "$TIPO" in
6250
''|*[!0-9]*)
6351
echo -e "${VERMELHO} Enter only numbers referring to the TYPE of the password ${FECHA}"
@@ -69,12 +57,13 @@ case $MAX in
6957
echo -e "${VERDE}$PASS${FECHA}"
7058
;;
7159
2)
72-
PASS=$(cat /dev/urandom LC_ALL=C | tr -dc 'A-Za-z0-9' | head -c "$MAX")
73-
command -v xclip > /dev/null && echo -n "$PASS" | xclip -sel copy || echo -n "$PASS" | pbcopy 2> /dev/null
74-
echo -e "${VERDE}$PASS${FECHA}"
60+
PASS=$(cat /dev/urandom LC_ALL=C | tr -dc 'A-Za-z0-9' | head -c "$MAX")
61+
command -v xclip > /dev/null && echo -n "$PASS" | xclip -sel copy || echo -n "$PASS" | pbcopy 2> /dev/null
62+
echo -e "${VERDE}$PASS${FECHA}"
7563
;;
7664
3)
77-
PASS=$(cat /dev/urandom LC_ALL=C | tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_{|}~' | head -c "$MAX")
65+
PASS=$(cat /dev/urandom LC_ALL=C |
66+
tr -dc 'A-Za-z0-9!"#$%&'\''()*+,-./:;<=>?@[\]^_{|}~' | head -c "$MAX")
7867
command -v xclip > /dev/null && echo -n "$PASS" | xclip -sel copy || echo -n "$PASS" | pbcopy 2> /dev/null
7968
echo -e "${VERDE}$PASS${FECHA}"
8069
;;
@@ -84,10 +73,12 @@ case $MAX in
8473
;;
8574
esac
8675
esac
87-
# write in local file
76+
# write in file
8877
echo "$(date '+%d/%m/%y %H:%M:%S') - $PASS" >> $(pwd)/history.log
78+
8979
}
9080
#---------MAIN-------------------------------------------------------------------|
81+
9182
case "$MAX" in
9283
h | -h | --help )
9384
echo -e "$USAGE"

0 commit comments

Comments
 (0)