#!/sbin/runscript opts="${opts} dump restore" depend() { need postgresql } restore() { [ -z "$PGDUMP" ] && return 0 ebegin "Restoring PostgreSQL $PGDUMP" psql -U ${PG_USER:-postgres} ${PSQL_OPTS} -f "$PGDUMP" eend $? if [ -z "$KEEP_DUMP" ]; then rm -f "$PGDUMP" fi } dump() { [ -z "$PGDUMP" ] && return 0 pg_dumpall -U ${PG_USER:-postgres} ${PG_DUMPALL_OPTS} -f "$PGDUMP" } start() { restore } stop() { dump }