mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-29 20:04:05 +02:00
GitHub bot: fix linting issues (nobuild)
This commit is contained in:
21
ente/rootfs/etc/cont-init.d/99-run.sh
Executable file → Normal file
21
ente/rootfs/etc/cont-init.d/99-run.sh
Executable file → Normal file
@@ -47,13 +47,20 @@ MC_BIN="/usr/local/bin/mc"
|
||||
|
||||
# runtime binary resolver
|
||||
resolve_bin() {
|
||||
local name="$1"; shift
|
||||
local name="$1"
|
||||
shift
|
||||
local cand
|
||||
for cand in "$@"; do
|
||||
[ -x "$cand" ] && { echo "$cand"; return 0; }
|
||||
[ -x "$cand" ] && {
|
||||
echo "$cand"
|
||||
return 0
|
||||
}
|
||||
done
|
||||
cand="$(command -v "$name" 2>/dev/null || true)"
|
||||
[ -n "$cand" ] && { echo "$cand"; return 0; }
|
||||
[ -n "$cand" ] && {
|
||||
echo "$cand"
|
||||
return 0
|
||||
}
|
||||
echo ""
|
||||
return 1
|
||||
}
|
||||
@@ -129,8 +136,8 @@ bootstrap_internal_db() {
|
||||
|
||||
bashio::log.info "Ensuring role ${DB_USER} exists..."
|
||||
if ! psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -tAc \
|
||||
"SELECT 1 FROM pg_roles WHERE rolname='${DB_USER}'" \
|
||||
| grep -q 1; then
|
||||
"SELECT 1 FROM pg_roles WHERE rolname='${DB_USER}'" |
|
||||
grep -q 1; then
|
||||
# password quoting: single quotes doubled
|
||||
esc_pass="${DB_PASS//\'/\'\'}"
|
||||
psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -c \
|
||||
@@ -141,8 +148,8 @@ bootstrap_internal_db() {
|
||||
fi
|
||||
bashio::log.info "Ensuring database ${DB_NAME} exists (owner ${DB_USER})..."
|
||||
if ! psql -h "$DB_HOST_INTERNAL" -p "$DB_PORT_INTERNAL" -U postgres -tAc \
|
||||
"SELECT 1 FROM pg_database WHERE datname='${DB_NAME}'" \
|
||||
| grep -q 1; then
|
||||
"SELECT 1 FROM pg_database WHERE datname='${DB_NAME}'" |
|
||||
grep -q 1; then
|
||||
# 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 \
|
||||
"CREATE DATABASE ${DB_NAME} OWNER ${DB_USER}"
|
||||
|
||||
Reference in New Issue
Block a user