mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-28 00:40:31 +02:00
rename
This commit is contained in:
21
postgres_15/rootfs/etc/cont-init.d/20-folders.sh
Executable file
21
postgres_15/rootfs/etc/cont-init.d/20-folders.sh
Executable file
@@ -0,0 +1,21 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
set -e
|
||||
|
||||
# Migration
|
||||
if [ -d /data/database ]; then
|
||||
bashio::log.warning "Database migrated to /config"
|
||||
mv /data/database /config
|
||||
fi
|
||||
|
||||
if [ -f /homeassistant/addons_config/postgres/config.yaml ]; then
|
||||
bashio::log.warning "Config migrated to /config"
|
||||
mv /homeassistant/addons_config/postgres/* /config/
|
||||
rm -r /homeassistant/addons_config/postgres
|
||||
# Correct database location
|
||||
sed -i "s|/data/database|/config/database|g" /config/postgresql.conf
|
||||
fi
|
||||
|
||||
# touch sql file
|
||||
touch /setup_postgres.sql
|
||||
chmod 755 /setup_postgres.sql
|
||||
Reference in New Issue
Block a user