mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-10 09:51:02 +01:00
fix: auto-fix linting issues
This commit is contained in:
committed by
github-actions[bot]
parent
3539f328fb
commit
f5428e0950
@@ -15,33 +15,33 @@ mkdir -p "$STORAGE_FOLDER"
|
||||
|
||||
bashio::log.info "Setting postgres..."
|
||||
if [[ "$DATABASE_URL" == *"localhost"* ]]; then
|
||||
echo "... with local database"
|
||||
echo "... set database in /config/postgres"
|
||||
mkdir -p /config/postgres
|
||||
mkdir -p /var/run/postgresql
|
||||
chown postgres:postgres /var/run/postgresql
|
||||
chown -R postgres:postgres /config/postgres
|
||||
chmod 0700 /config/postgres
|
||||
# Create folder
|
||||
if [ ! -e /config/postgres/postgresql.conf ]; then
|
||||
echo "... init folder"
|
||||
sudo -u postgres /usr/lib/postgresql/16/bin/initdb -D /config/postgres
|
||||
fi
|
||||
chown -R postgres:postgres /config/postgres
|
||||
chmod 0700 /config/postgres
|
||||
echo "... with local database"
|
||||
echo "... set database in /config/postgres"
|
||||
mkdir -p /config/postgres
|
||||
mkdir -p /var/run/postgresql
|
||||
chown postgres:postgres /var/run/postgresql
|
||||
chown -R postgres:postgres /config/postgres
|
||||
chmod 0700 /config/postgres
|
||||
# Create folder
|
||||
if [ ! -e /config/postgres/postgresql.conf ]; then
|
||||
echo "... init folder"
|
||||
sudo -u postgres /usr/lib/postgresql/16/bin/initdb -D /config/postgres
|
||||
fi
|
||||
chown -R postgres:postgres /config/postgres
|
||||
chmod 0700 /config/postgres
|
||||
|
||||
echo "... starting server"
|
||||
sudo -u postgres service postgresql start
|
||||
sleep 5
|
||||
echo "... starting server"
|
||||
sudo -u postgres service postgresql start
|
||||
sleep 5
|
||||
|
||||
echo "... create user and table"
|
||||
# Set password
|
||||
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'homeassistant';"
|
||||
echo "... create user and table"
|
||||
# Set password
|
||||
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'homeassistant';"
|
||||
|
||||
# Create database if does not exist
|
||||
echo "CREATE DATABASE linkwarden; GRANT ALL PRIVILEGES ON DATABASE linkwarden to postgres;
|
||||
\q" >setup_postgres.sql
|
||||
sudo -u postgres bash -c 'cat setup_postgres.sql | psql "postgres://postgres:homeassistant@localhost:5432"' || true
|
||||
# Create database if does not exist
|
||||
echo "CREATE DATABASE linkwarden; GRANT ALL PRIVILEGES ON DATABASE linkwarden to postgres;
|
||||
\q" > setup_postgres.sql
|
||||
sudo -u postgres bash -c 'cat setup_postgres.sql | psql "postgres://postgres:homeassistant@localhost:5432"' || true
|
||||
fi
|
||||
|
||||
########################
|
||||
|
||||
Reference in New Issue
Block a user