fix command in case adduser no exist

This commit is contained in:
gamer4life1 2020-10-10 18:54:44 +00:00
parent b753b8da92
commit 0ff01d014a

View File

@ -17,6 +17,10 @@ VIRGL_PID="$!"
# Ensure Groups Are Correct # Ensure Groups Are Correct
if [ -z "${MCPI_SUBSHELL}" ]; then if [ -z "${MCPI_SUBSHELL}" ]; then
if ! id -Gn "$(whoami)" | grep '\bdocker\b' > /dev/null; then if ! id -Gn "$(whoami)" | grep '\bdocker\b' > /dev/null; then
if ! command -v adduser &> /dev/null
then
pkexec usermod -aG "$(whoami)" docker
fi
pkexec adduser "$(whoami)" docker pkexec adduser "$(whoami)" docker
fi fi
exec sg docker "env MCPI_SUBSHELL=1 \"$(realpath -e "$0")\"" exec sg docker "env MCPI_SUBSHELL=1 \"$(realpath -e "$0")\""