Tweak Startup Script

This commit is contained in:
TheBrokenRail 2020-10-01 15:25:02 -04:00
parent 9198fff5b3
commit 48e963ba6f
2 changed files with 4 additions and 9 deletions

View File

@ -4,4 +4,4 @@ Maintainer: TheBrokenRail <connor24nolan@live.com>
Description: Fun with Blocks
Homepage: https://www.minecraft.net/en-us/edition/pi
Architecture: amd64
Depends: docker.io, docker-compose, virgl-server, zenity, policykit-1, adduser
Depends: docker.io, docker-compose, virgl-server, zenity, policykit-1, adduser, login

View File

@ -3,11 +3,8 @@
set -e
# Ensure Features Are Selected
USER_LAUNCH=1
if [ -z "${MCPI_FEATURES}" ]; then
if [ -z "${MCPI_SUBSHELL}" ]; then
MCPI_FEATURES="$(zenity --class minecraft-pi --list --checklist --column 'Enabled' --column 'Feature' FALSE 'Touch GUI' FALSE 'Survival Mode' FALSE 'Fix Bow & Arrow' FALSE 'Fix Attacking' FALSE 'Mob Spawning')"
else
USER_LAUNCH=0
fi
export MCPI_FEATURES
@ -16,13 +13,11 @@ virgl_test_server &
VIRGL_PID="$!"
# Ensure Groups Are Correct
if [ "${USER_LAUNCH}" = "1" ]; then
if [ -z "${MCPI_SUBSHELL}" ]; then
if ! id -Gn "$(whoami)" | grep '\bdocker\b' > /dev/null; then
pkexec adduser "$(whoami)" docker
fi
su -p "$(whoami)" "$(realpath -e "$0")"
exit "$?"
exec sg docker "env MCPI_SUBSHELL=1 \"$(realpath -e "$0")\""
fi
# Allow X11 Connections From Root