From 7279ac22c154a3a4ceab9e3fa5117a4617b9d75a Mon Sep 17 00:00:00 2001 From: mrrudy <31594962+mrrudy@users.noreply.github.com> Date: Sat, 22 Oct 2022 21:27:06 +0200 Subject: [PATCH] different groups host<>guest mapping --- ct/kodi-v1.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ct/kodi-v1.sh b/ct/kodi-v1.sh index 18256356..d936b5ba 100644 --- a/ct/kodi-v1.sh +++ b/ct/kodi-v1.sh @@ -272,7 +272,7 @@ lxc.idmap: u 0 100000 65536 EOF #TODO internalize code to generate mapping instad of using external python script LXC_SUB_CONF=$(python3 -c "$(wget -qLO - https://raw.githubusercontent.com/ddimick/proxmox-lxc-idmapper/master/run.py)" \ - ${VIDEO_GID}=${VIDEO_GID} ${TTY_GID}=${TTY_GID} ${INPUT_GID}=${INPUT_GID} ${AUDIO_GID}=${AUDIO_GID}) + ${VIDEO_GID}=$(getent group video | cut -d: -f3) ${TTY_GID}=$(getent group tty | cut -d: -f3) ${INPUT_GID}=$(getent group input | cut -d: -f3) ${AUDIO_GID}=$(getent group audio | cut -d: -f3)) echo "$LXC_SUB_CONF" | grep 'lxc.idmap: g ' >> $LXC_CONFIG # on host add rights to map gids but only if they are not already in the file echo "$LXC_SUB_CONF" | sed -n '/subgid/,// { /subgid/! p }' | while read line; do cat /etc/subgid | sed 's/[[:blank:]]*//g' | grep -qxF "$line" || echo $line >> /etc/subgid; done