Replace duplicate random generator with common function

This commit is contained in:
Jason Ertel
2020-12-11 13:22:13 -05:00
parent 2f2867804a
commit eb735c7289
5 changed files with 28 additions and 22 deletions

View File

@@ -135,3 +135,8 @@ fail() {
echo "Exiting."
exit 1
}
get_random_value() {
length=${1:-20}
head -c 5000 /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w $length | head -n 1
}