From d6ef841b9b47d4798158007c6cc73fff2bc98671 Mon Sep 17 00:00:00 2001 From: tteckster Date: Wed, 2 Nov 2022 20:29:04 -0400 Subject: [PATCH] Update zigbee2mqtt-v4.sh If the LXC is created Privileged, the script will automatically set up USB passthrough. --- ct/zigbee2mqtt-v4.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/ct/zigbee2mqtt-v4.sh b/ct/zigbee2mqtt-v4.sh index 2c1881a5..d19c5a03 100644 --- a/ct/zigbee2mqtt-v4.sh +++ b/ct/zigbee2mqtt-v4.sh @@ -256,10 +256,11 @@ export PCT_OPTIONS=" $PW " bash -c "$(wget -qLO - https://raw.githubusercontent.com/tteck/Proxmox/main/ct/create_lxc.sh)" || exit -LXC_CONFIG=/etc/pve/lxc/${CTID}.conf -cat <>$LXC_CONFIG +if [ "$CT_TYPE" == "0" ]; then + LXC_CONFIG=/etc/pve/lxc/${CTID}.conf + cat <>$LXC_CONFIG lxc.cgroup2.devices.allow: a -lxc.cap.drop: +lxc.cap.drop: lxc.cgroup2.devices.allow: c 188:* rwm lxc.cgroup2.devices.allow: c 189:* rwm lxc.mount.entry: /dev/serial/by-id dev/serial/by-id none bind,optional,create=dir @@ -268,6 +269,7 @@ lxc.mount.entry: /dev/ttyUSB1 dev/ttyUSB1 none bind,optional,create= lxc.mount.entry: /dev/ttyACM0 dev/ttyACM0 none bind,optional,create=file lxc.mount.entry: /dev/ttyACM1 dev/ttyACM1 none bind,optional,create=file EOF +fi msg_info "Starting LXC Container" pct start $CTID msg_ok "Started LXC Container"