Skip to content

Commit

Permalink
Indent test peripheral messages
Browse files Browse the repository at this point in the history
  • Loading branch information
Tony Edgin committed Jul 9, 2023
1 parent 192520e commit 3efdb38
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions test/control-dbms.sh
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,35 @@ main() {
esac
}


start_dbms() {
printf 'Starting PostgreSQL\n'

sudo --user postgres \
/usr/lib/postgresql/10/bin/pg_ctl \
--log=/var/log/postgresql/postgresql-10-main.log \
--options='--config_file=/etc/postgresql/10/main/postgresql.conf' \
--pgdata=/var/lib/postgresql/10/main \
start
/usr/lib/postgresql/10/bin/pg_ctl \
--log=/var/log/postgresql/postgresql-10-main.log \
--options='--config_file=/etc/postgresql/10/main/postgresql.conf' \
--pgdata=/var/lib/postgresql/10/main \
start \
> >(indent /dev/stdout) \
2> >(indent /dev/stderr)
}


stop_dbms() {
printf 'Stopping PostgreSQL\n'
sudo --user postgres /usr/lib/postgresql/10/bin/pg_ctl --pgdata=/var/lib/postgresql/10/main stop

sudo --user postgres \
/usr/lib/postgresql/10/bin/pg_ctl --pgdata=/var/lib/postgresql/10/main stop \
> >(indent /dev/stdout) \
2> >(indent /dev/stderr)
}

indent() {
local out="$1"

local line
while read -r line; do
printf '\t%s\n' "$line"
done > "$out"
}

main "$@"

0 comments on commit 3efdb38

Please sign in to comment.