#!/bin/sh
# Opens Emplio on Linux. Ubuntu 23.10 and newer block the sandbox Chromium sets up for itself unless chrome-sandbox
# is owned by root (an installer package would do that; this is a plain folder). There it starts without that sandbox
# rather than not at all. ponytail: a .deb that sets chrome-sandbox up (chown root, chmod 4755) lifts this.
here="$(dirname "$(readlink -f "$0")")"
if [ "$(cat /proc/sys/kernel/apparmor_restrict_unprivileged_userns 2>/dev/null)" = 1 ] && [ ! -u "$here/chrome-sandbox" ]; then
  exec "$here/emplio-app" --no-sandbox "$@"
fi
exec "$here/emplio-app" "$@"
