Improve permissions

This commit is contained in:
Alexandre
2024-07-02 19:34:58 +02:00
committed by GitHub
parent 822f9cb0f9
commit ef8cbb87cb

View File

@@ -14,14 +14,12 @@ ln -sf /config /home/node/.signalk
chown -R node:node /config
chown -R node:node /home/node/.signalk
# Define permissions for /dev/ttyUSB
for device in /dev/ttyUSB /dev/ttyUSB0 /dev/ttyUSB1; do
if [ -f "$device" ]; do
usermod -a -G "$(stat -c "%G" "$device")" $USER
chmod 777 "$device"
chown "$USER" "$device"
done
done
# Give node user permissions for devices
for group in tty dialout plugdev uucp; do
if compgen -g | grep -q "$group"; then
usermod -a -G "$group" "$USER" || true
fi
done
bashio::log.info "Starting application"