2021-03-03 03:26:34 +01:00
|
|
|
#!/usr/bin/env bash
|
2021-05-12 03:06:25 +02:00
|
|
|
|
|
|
|
# do not set -x here because it will fail on non-debian based distrib
|
|
|
|
# set -e
|
2021-03-16 03:56:18 +01:00
|
|
|
|
|
|
|
# Some distributions do not have unprivileged_userns_clone disabled.
|
|
|
|
# If that's the case, and we run an AppImage (deb is not impacted by this),
|
|
|
|
# the app won't start unless we start it with --no-sandbox.
|
|
|
|
# This bash script is the launcher script for AppImage only, and will at runtime check
|
|
|
|
# if we need to add the --no-sandbox before running the AppImage itself.
|
2021-03-03 03:26:34 +01:00
|
|
|
|
|
|
|
UNPRIVILEGED_USERNS_ENABLED=$(cat /proc/sys/kernel/unprivileged_userns_clone 2>/dev/null)
|
|
|
|
SCRIPT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
|
|
|
exec "$SCRIPT_DIR/session-desktop-bin" "$([[ $UNPRIVILEGED_USERNS_ENABLED == 0 ]] && echo '--no-sandbox')" "$@"
|