From 2ca436f8e8e46084ea96eb4582784f8f72cfd095 Mon Sep 17 00:00:00 2001 From: alexbelgium <44178713+alexbelgium@users.noreply.github.com> Date: Mon, 28 Jul 2025 09:53:42 +0000 Subject: [PATCH] fix: auto-fix linting issues --- .templates/ha_entrypoint.sh | 10 +++++----- birdnet-pi/rootfs/etc/cont-init.d/81-modifications.sh | 5 ++--- birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py | 5 +++-- emby_beta/rootfs/etc/services.d/nginx/run | 0 guacamole/rootfs/etc/services.d/nginx/run | 0 .../rootfs/etc/s6-overlay/s6-rc.d/init-alexbelgium/run | 0 portainer/rootfs/etc/services.d/nginx/run | 0 portainer/rootfs/etc/services.d/portainer/run | 0 8 files changed, 10 insertions(+), 10 deletions(-) mode change 100644 => 100755 emby_beta/rootfs/etc/services.d/nginx/run mode change 100644 => 100755 guacamole/rootfs/etc/services.d/nginx/run mode change 100644 => 100755 piwigo/rootfs/etc/s6-overlay/s6-rc.d/init-alexbelgium/run mode change 100644 => 100755 portainer/rootfs/etc/services.d/nginx/run mode change 100644 => 100755 portainer/rootfs/etc/services.d/portainer/run diff --git a/.templates/ha_entrypoint.sh b/.templates/ha_entrypoint.sh index aab2574b0..9e311a3b3 100755 --- a/.templates/ha_entrypoint.sh +++ b/.templates/ha_entrypoint.sh @@ -57,7 +57,7 @@ run_script() { fi # Replace s6-setuidgid with su fallback if s6-setuidgid is missing - if ! command -v s6-setuidgid >/dev/null 2>&1; then + if ! command -v s6-setuidgid > /dev/null 2>&1; then sed -i -E 's|s6-setuidgid[[:space:]]+([a-zA-Z0-9._-]+)[[:space:]]+(.*)$|su -s /bin/bash \1 -c "\2"|g' "$runfile" fi @@ -114,21 +114,21 @@ if "$PID1"; then if command -v pgrep &> /dev/null; then for pid in $(pgrep -P "$$"); do echo "Terminating child PID $pid" - kill -TERM "$pid" 2>/dev/null || echo "Failed to terminate PID $pid" + kill -TERM "$pid" 2> /dev/null || echo "Failed to terminate PID $pid" done else for pid in /proc/[0-9]*/; do pid=${pid#/proc/} pid=${pid%/} - if [[ "$pid" -ne 1 ]] && grep -q "^PPid:\s*$$" "/proc/$pid/status" 2>/dev/null; then + if [[ "$pid" -ne 1 ]] && grep -q "^PPid:\s*$$" "/proc/$pid/status" 2> /dev/null; then echo "Terminating child PID $pid" - kill -TERM "$pid" 2>/dev/null || echo "Failed to terminate PID $pid" + kill -TERM "$pid" 2> /dev/null || echo "Failed to terminate PID $pid" fi done fi sleep 5 - kill -KILL -$$ 2>/dev/null || true + kill -KILL -$$ 2> /dev/null || true wait echo "All subprocesses terminated. Exiting." exit 0 diff --git a/birdnet-pi/rootfs/etc/cont-init.d/81-modifications.sh b/birdnet-pi/rootfs/etc/cont-init.d/81-modifications.sh index 797daf080..2fc5187b8 100755 --- a/birdnet-pi/rootfs/etc/cont-init.d/81-modifications.sh +++ b/birdnet-pi/rootfs/etc/cont-init.d/81-modifications.sh @@ -48,9 +48,9 @@ if export "$(grep "^DATABASE_LANG" /config/birdnet.conf)"; then export "$(grep "^MODEL" /config/birdnet.conf)" bashio::log.info "Setting language to ${DATABASE_LANG:-en}" if [ "$MODEL" == "BirdNET_GLOBAL_6K_V2.4_Model_FP16" ]; then - BASEDIR=labels_nm + BASEDIR=labels_nm else - BASEDIR=labels_l18n + BASEDIR=labels_l18n fi label_file_name="labels_${DATABASE_LANG}.txt" ln -sf "$HOME/BirdNET-Pi/model/${BASEDIR}/${label_file_name}" "$HOME/BirdNET-Pi/model/labels.txt" || bashio::log.warning "Failed to update language labels" @@ -168,4 +168,3 @@ grep -rl "RECS_DIR" "$HOME" --exclude="*.php" | while read -r file; do sed -i "/^\$RECS_DIR=/c \$RECS_DIR=/tmp" "$file" done mkdir -p /tmp - diff --git a/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py b/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py index e1405397b..fb6492981 100644 --- a/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py +++ b/birdnet-pi/rootfs/helpers/birdnet_to_mqtt.py @@ -3,13 +3,14 @@ import json import logging +import os import re import sys -import os + import paho.mqtt.client as mqtt import requests -utils_path = os.path.expanduser('~/BirdNET-Pi/scripts/utils') +utils_path = os.path.expanduser("~/BirdNET-Pi/scripts/utils") sys.path.append(utils_path) from helpers import get_settings diff --git a/emby_beta/rootfs/etc/services.d/nginx/run b/emby_beta/rootfs/etc/services.d/nginx/run old mode 100644 new mode 100755 diff --git a/guacamole/rootfs/etc/services.d/nginx/run b/guacamole/rootfs/etc/services.d/nginx/run old mode 100644 new mode 100755 diff --git a/piwigo/rootfs/etc/s6-overlay/s6-rc.d/init-alexbelgium/run b/piwigo/rootfs/etc/s6-overlay/s6-rc.d/init-alexbelgium/run old mode 100644 new mode 100755 diff --git a/portainer/rootfs/etc/services.d/nginx/run b/portainer/rootfs/etc/services.d/nginx/run old mode 100644 new mode 100755 diff --git a/portainer/rootfs/etc/services.d/portainer/run b/portainer/rootfs/etc/services.d/portainer/run old mode 100644 new mode 100755