Skip to content

Commit

Permalink
#43 fix for macs
Browse files Browse the repository at this point in the history
  • Loading branch information
fuzziebrain committed Jul 11, 2021
1 parent 04c071d commit 113f5b1
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions quickstart.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,17 @@
##### Functions #####
function generate_password() {
# SC => special characters allowed
SC="_-"
SC="_"
while
_password=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9'$SC | head -c $(($RANDOM % 6 + 15)))
[[
$(echo $_password | grep -o '['$SC']' | wc -l) < 2
|| $(echo $_password | grep -o '[0-9]' | wc -l) < 2
|| $(echo $_password | grep -o '[A-Z]' | wc -l) < 2
|| $(echo $_password | grep -o '[a-z]' | wc -l) < 2
_password=$(openssl rand -base64 $(($RANDOM % 6 + 15)) | tr '[:punct:]' $SC)
[[
$(echo $_password | grep -o '['$SC']' | wc -l) -lt 2
|| $(echo $_password | grep -o '[0-9]' | wc -l) -lt 2
|| $(echo $_password | grep -o '[A-Z]' | wc -l) -lt 2
|| $(echo $_password | grep -o '[a-z]' | wc -l) -lt 2
]]
do true; done

echo $_password
}

Expand Down

0 comments on commit 113f5b1

Please sign in to comment.