aports/community/postgresql-bdr/pgbdr-restore.initd
Jakub Jirutka 0201ddc3ca community/postgresql-bdr: move from main
The last release was in 2017, i.e. this project is dead and we can
hardly provide support that is expected from packages in the main
repository. I wanted to remove it, but Leonardo Arena objected:

> These packages are currently deployed in hundreds of installations in
> a large corporate network which is contributing to the Alpine project.
> So it will be detrimental for Alpine to remove them.

For this reason, we keep it in aports and just move to the community
repository.

The only package that depends on postgresql-bdr is
postgresql-bdr-extension.
2021-11-16 23:09:48 +01:00

37 lines
708 B
Plaintext

#!/sbin/openrc-run
extra_commands="${opts} dump restore purge"
depend() {
need postgresql-bdr
}
restore() {
yesno "$PGDUMP" && return 0
ebegin "Restoring PostgreSQL $PGDUMP"
psql -U ${PG_USER:-postgres} ${PSQL_OPTS} -f "$PGDUMP" >/dev/null 2>/dev/null
local res=$?
yesno "$KEEP_DUMP" || rm -f "$PGDUMP"
eend $res
/etc/init.d/postgresql-bdr reload
}
dump() {
yesno "$PGDUMP" && return 0
mkdir -p "$( dirname "$PGDUMP" )"
ebegin "Saving PostgreSQL databases to $PGDUMP"
pg_dumpall -U ${PG_USER:-postgres} ${PG_DUMPALL_OPTS} -f "$PGDUMP"
eend $?
}
purge() {
yesno "$PGDUMP" && return 0
ebegin "Removing temporary $PGDUMP PostgreSQL backup"
rm -f "$PGDUMP"
eend $?
}
start() {
restore
}