mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-09-02 10:13:32 +02:00
Lint
This commit is contained in:
@@ -18,7 +18,7 @@ if [[ "$DATABASE_URL" == *"localhost"* ]]; then
|
|||||||
echo "... with local database"
|
echo "... with local database"
|
||||||
echo "... set database in /config/postgres"
|
echo "... set database in /config/postgres"
|
||||||
mkdir -p /config/postgres
|
mkdir -p /config/postgres
|
||||||
mkdir -p /var/run/postgresql
|
mkdir -p /var/run/postgresql
|
||||||
chown postgres:postgres /var/run/postgresql
|
chown postgres:postgres /var/run/postgresql
|
||||||
chown -R postgres:postgres /config/postgres
|
chown -R postgres:postgres /config/postgres
|
||||||
chmod 0700 /config/postgres
|
chmod 0700 /config/postgres
|
||||||
@@ -29,19 +29,19 @@ if [[ "$DATABASE_URL" == *"localhost"* ]]; then
|
|||||||
fi
|
fi
|
||||||
chown -R postgres:postgres /config/postgres
|
chown -R postgres:postgres /config/postgres
|
||||||
chmod 0700 /config/postgres
|
chmod 0700 /config/postgres
|
||||||
|
|
||||||
echo "... starting server"
|
echo "... starting server"
|
||||||
sudo -u postgres service postgresql start
|
sudo -u postgres service postgresql start
|
||||||
sleep 5
|
sleep 5
|
||||||
|
|
||||||
echo "... create user and table"
|
echo "... create user and table"
|
||||||
# Set password
|
# Set password
|
||||||
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'homeassistant';"
|
sudo -u postgres psql -c "ALTER USER postgres WITH PASSWORD 'homeassistant';"
|
||||||
|
|
||||||
# Create database if does not exist
|
# Create database if does not exist
|
||||||
echo "CREATE DATABASE linkwarden; GRANT ALL PRIVILEGES ON DATABASE linkwarden to postgres;
|
echo "CREATE DATABASE linkwarden; GRANT ALL PRIVILEGES ON DATABASE linkwarden to postgres;
|
||||||
\q"> setup_postgres.sql
|
\q"> setup_postgres.sql
|
||||||
sudo -u postgres psql "postgres://postgres:homeassistant@localhost:5432" < setup_postgres.sql || true
|
sudo -u postgres bash -c 'psql "postgres://postgres:homeassistant@localhost:5432"' < setup_postgres.sql || true
|
||||||
fi
|
fi
|
||||||
|
|
||||||
########################
|
########################
|
||||||
|
|||||||
Reference in New Issue
Block a user