GitHub bot: fix linting issues (nobuild)

This commit is contained in:
github-actions
2025-07-16 19:43:46 +00:00
parent 65b1ba83b1
commit bb1a052d07

21
ente/rootfs/etc/cont-init.d/99-run.sh Executable file → Normal file
View File

@@ -47,13 +47,20 @@ MC_BIN="/usr/local/bin/mc"
# runtime binary resolver # runtime binary resolver
resolve_bin() { resolve_bin() {
local name="$1"; shift local name="$1"
shift
local cand local cand
for cand in "$@"; do for cand in "$@"; do
[ -x "$cand" ] && { echo "$cand"; return 0; } [ -x "$cand" ] && {
echo "$cand"
return 0
}
done done
cand="$(command -v "$name" 2>/dev/null || true)" cand="$(command -v "$name" 2>/dev/null || true)"
[ -n "$cand" ] && { echo "$cand"; return 0; } [ -n "$cand" ] && {
echo "$cand"
return 0
}
echo "" echo ""
return 1 return 1
} }
@@ -129,8 +136,8 @@ bootstrap_internal_db() {
bashio::log.info "Ensuring role ${DB_USER} exists..." bashio::log.info "Ensuring role ${DB_USER} exists..."
if ! psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -tAc \ if ! psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -tAc \
"SELECT 1 FROM pg_roles WHERE rolname='${DB_USER}'" \ "SELECT 1 FROM pg_roles WHERE rolname='${DB_USER}'" |
| grep -q 1; then grep -q 1; then
# password quoting: single quotes doubled # password quoting: single quotes doubled
esc_pass="${DB_PASS//\'/\'\'}" esc_pass="${DB_PASS//\'/\'\'}"
psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -c \ psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -c \
@@ -141,8 +148,8 @@ bootstrap_internal_db() {
fi fi
bashio::log.info "Ensuring database ${DB_NAME} exists (owner ${DB_USER})..." bashio::log.info "Ensuring database ${DB_NAME} exists (owner ${DB_USER})..."
if ! psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -tAc \ if ! psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -tAc \
"SELECT 1 FROM pg_database WHERE datname='${DB_NAME}'" \ "SELECT 1 FROM pg_database WHERE datname='${DB_NAME}'" |
| grep -q 1; then grep -q 1; then
# CREATE DATABASE must be top-level (not in DO/transaction). :contentReference[oaicite:2]{index=2} # CREATE DATABASE must be top-level (not in DO/transaction). :contentReference[oaicite:2]{index=2}
psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -c \ psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -c \
"CREATE DATABASE ${DB_NAME} OWNER ${DB_USER}" "CREATE DATABASE ${DB_NAME} OWNER ${DB_USER}"