chatdesk-ui/postgres_15.8.1.044/ansible/files/pgsodium_getkey_urandom.sh.j2

11 lines
208 B
Django/Jinja
Executable File

#!/bin/bash
set -euo pipefail
KEY_FILE=/etc/postgresql-custom/pgsodium_root.key
if [[ ! -f "${KEY_FILE}" ]]; then
head -c 32 /dev/urandom | od -A n -t x1 | tr -d ' \n' > "${KEY_FILE}"
fi
cat $KEY_FILE