Cleaner code

This commit is contained in:
Alexandre
2025-02-12 21:49:01 +01:00
committed by GitHub
parent 3a2340f48c
commit a57a4e8eb4

View File

@@ -12,17 +12,12 @@ fi
USER=node USER=node
if bashio::config.true "RUN_AS_ROOT"; then if bashio::config.true "RUN_AS_ROOT"; then
USER="root" USER="root"
HOMEDIR="/root"
bashio::log.warning "RUN_AS is set, app will run as $USER" bashio::log.warning "RUN_AS is set, app will run as $USER"
ln -sf /config "/root/.signalk" ln -sf /config "/root/.signalk"
else ln -sf /usr/lib/node_modules/signalk-server /root/signalk
HOMEDIR="/home/node"
ln -sf /config "/home/node/.signalk"
fi fi
ln -sf /config "/home/node/.signalk"
chown -R "$USER:$USER" /config chown -R "$USER:$USER" /config
ln -sf /config "$HOMEDIR/.signalk"
chown -R "$USER:$USER" "$HOMEDIR"
chown -R "$USER:$USER" "$HOMEDIR/.signalk"
# Option 1 : define permissions for /dev/ttyUSB # Option 1 : define permissions for /dev/ttyUSB
for device in /dev/ttyUSB /dev/ttyUSB0 /dev/ttyUSB1; do for device in /dev/ttyUSB /dev/ttyUSB0 /dev/ttyUSB1; do
@@ -37,7 +32,6 @@ for device in /dev/ttyUSB /dev/ttyUSB0 /dev/ttyUSB1; do
fi fi
done || true done || true
# Option 2 : set single user for SSL files # Option 2 : set single user for SSL files
for file in ssl-key.pem ssl-cert.pem security.json; do for file in ssl-key.pem ssl-cert.pem security.json; do
if [ -e "/config/$file" ]; then if [ -e "/config/$file" ]; then