diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2019-08-01 09:17:28 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2019-08-08 09:03:13 +0200 |
commit | fe4b8b3a499270df23b1ac3f0d8ec17e22f055ae (patch) | |
tree | c4289930d02edfbec8e5ce590bf847053e304f41 /ansible/odoo/docker/set-admin-passwd.sh | |
parent | b013a2d14b99eb3d76877e52f863832e421d3d70 (diff) | |
download | infra-fe4b8b3a499270df23b1ac3f0d8ec17e22f055ae.tar.gz infra-fe4b8b3a499270df23b1ac3f0d8ec17e22f055ae.tar.bz2 infra-fe4b8b3a499270df23b1ac3f0d8ec17e22f055ae.tar.xz infra-fe4b8b3a499270df23b1ac3f0d8ec17e22f055ae.zip |
o Building my own variant of odoo:12, based on upstream odoo:12 with
support for setting admin_passwd.
Diffstat (limited to 'ansible/odoo/docker/set-admin-passwd.sh')
-rwxr-xr-x | ansible/odoo/docker/set-admin-passwd.sh | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/ansible/odoo/docker/set-admin-passwd.sh b/ansible/odoo/docker/set-admin-passwd.sh new file mode 100755 index 0000000..4c363b1 --- /dev/null +++ b/ansible/odoo/docker/set-admin-passwd.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +set -euo pipefail + +: ${ADMIN_PASSWD:=`< /dev/urandom tr -dc A-Za-z0-9 | head -c16; echo`} + +# /etc/odoo is owned by root, can't create new files. +TMPFILE=$(mktemp) +sed -e "/^admin_passwd/d" \ + -e "$ a admin_passwd = $ADMIN_PASSWD" \ + $ODOO_RC > $TMPFILE +cat $TMPFILE > $ODOO_RC +rm -f $TMPFILE + +exec /entrypoint.sh "${@}" |