Skip to content

Commit 4d2a227

Browse files
committed
fix: check size from
1 parent 9addfda commit 4d2a227

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

shellPass.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -58,12 +58,12 @@ main() {
5858
;;
5959
*)
6060
echo "This is compatible only for GNU/Linux, MacOS or WSL2"
61-
exit 1
61+
return 1
6262
;;
6363
esac
6464
if [ ! -f "$DICT" ]; then
6565
echo "Dictionary not found, consider install package 'words'"
66-
exit 1
66+
return 1
6767
fi
6868
CPX=$(shuf -n "$MAX" "$DICT" | tr '\n' '-' | sed 's/-$//')
6969
;;
@@ -95,7 +95,7 @@ _checkSize() {
9595
}
9696

9797
_checkType() {
98-
while [[ "$TYPE" != [1-4] && "$TYPE" != [qQ] ]]; do
98+
while ! [[ "$TYPE" =~ ^[1-4]$|^[qQ]$ ]]; do
9999
echo -e "${BOLD} Enter the TYPE [1,2,3,4] for password complexity you want or [Q]uit ${FECHA}
100100
${ITALIC} 1 - Password only numbers ${FECHA}
101101
${ITALIC} 2 - Password with LeTtErS and numb3rs ${FECHA}
@@ -138,7 +138,7 @@ _makePass() {
138138
;;
139139
*)
140140
echo "This is compatible only for GNU/Linux, MacOS or WSL2"
141-
exit 1
141+
return 1
142142
;;
143143
esac
144144
}

0 commit comments

Comments
 (0)