Add instructions for macOS. #70
@ -7,7 +7,8 @@ if [[ -n "$CERC_SCRIPT_DEBUG" ]]; then
|
||||
fi
|
||||
|
||||
secure_password() {
|
||||
# extra bytes so that even if we delete some chars we will still have plenty
|
||||
# use openssl as the source, because it behaves similarly on both linux and macos
|
||||
# we generate extra bytes so that even if tr deletes some chars we will still have plenty
|
||||
openssl rand -base64 32 | tr -d '\/+=' | head -c 10 && echo
|
||||
|
telackey marked this conversation as resolved
Outdated
|
||||
}
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user
Should also change the comment in line 9 since it no longer pertains?
(but probably this change should be in a separate PR?)
Done
Was the change necessary because macos doesn't have
/dev/urandom?No, it has /dev/urandom, but
tris not able to consume it without explicitly settingLC_CTYPE=C, otherwise it complains about invalid input. Once you get past that hurdle, the options do not behave the same way, and '-dc' ends up selecting the complement of the set rather than deleting it, so you end up with only unprintable characters.Might be worthwhile adding a comment saying openssl used because it's available and works on both macos and Linux?
Added