initial commit
This commit is contained in:
20
scripts/odoo/init-odoo-with-perms.sh
Executable file
20
scripts/odoo/init-odoo-with-perms.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/bin/sh
|
||||
# Wrapper for odoo init: fix named volume ownership then run the original init script
|
||||
set -eu
|
||||
|
||||
OG="$(id -u odoo 2>/dev/null || id -u):$(id -g odoo 2>/dev/null || id -g)"
|
||||
echo "Fixing Odoo volumes to UID:GID=$OG"
|
||||
for d in /var/lib/odoo /etc/odo; do
|
||||
echo " -> chown $OG $d"
|
||||
chown -R "$OG" "$d" || true
|
||||
ls -ldn "$d" || true
|
||||
done
|
||||
|
||||
echo "Running Odoo init script"
|
||||
if command -v su >/dev/null 2>&1; then
|
||||
echo "Dropping to 'odoo' user to run init script via su"
|
||||
su -s /bin/sh odoo -c "/init-odoo.sh $*"
|
||||
else
|
||||
echo "su not available; running init script as current user"
|
||||
exec /init-odoo.sh "$@"
|
||||
fi
|
||||
Reference in New Issue
Block a user