You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
14 lines
306 B
14 lines
306 B
#!/usr/bin/env sh
|
|
|
|
# this generates a random 64 char hex string for all empty secret files in /secrets/*/*/*
|
|
|
|
set -o errexit
|
|
set -o nounset
|
|
set -o pipefail
|
|
|
|
for secret in /secrets/*/*/* ; do
|
|
test -d "$secret" && rmdir "$secret"
|
|
test -s "$secret" && continue
|
|
openssl rand -hex ${2:-64} > $secret
|
|
done
|