summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fd01c2e)
raw | patch | inline | side by side (parent: fd01c2e)
author | Sebastian Harl <sh@tokkee.org> | |
Mon, 30 Apr 2012 14:29:31 +0000 (16:29 +0200) | ||
committer | Sebastian Harl <sh@tokkee.org> | |
Mon, 30 Apr 2012 14:29:31 +0000 (16:29 +0200) |
Also, check for any additional arguments in all other commands.
pgtest.sh | patch | blob | history |
diff --git a/pgtest.sh b/pgtest.sh
index b88bf6c54938636d0f50f55dcae1c9de03c2615d..692de5e610abdb27bb5c72b1d702241d560c9163 100755 (executable)
--- a/pgtest.sh
+++ b/pgtest.sh
case "$1" in
setup)
+ if test $# -ne 1; then
+ echo "Too many arguments!" >&2
+ echo "Usage: $0 setup" >&2
+ exit 1
+ fi
mkdir -p $TARGET/var/lib/postgresql/main
mkdir -p $TARGET/var/run/postgresql
mkdir -p $TARGET/var/log/postgresql/main
export LD_PRELOAD="$LD_PRELOAD:$libreadline"
fi
fi
- $BIN_DIR/psql -h $TARGET/var/run/postgresql/ -p 5435
+ shift
+ $BIN_DIR/psql -h $TARGET/var/run/postgresql/ -p 5435 "$@"
;;
stop)
+ if test $# -ne 1; then
+ echo "Too many arguments!" >&2
+ echo "Usage: $0 setup" >&2
+ exit 1
+ fi
$BIN_DIR/pg_ctl -D $TARGET/var/lib/postgresql/main stop
;;
start)
- if test "$2" = "-B"; then
- $BIN_DIR/pg_ctl -D $TARGET/var/lib/postgresql/main -l logfile -w start
+ shift
+ if test "$1" = "-B"; then
+ shift
+ $BIN_DIR/pg_ctl -D $TARGET/var/lib/postgresql/main -l logfile -w start "$@"
else
- $BIN_DIR/postgres -D $TARGET/var/lib/postgresql/main
+ $BIN_DIR/postgres -D $TARGET/var/lib/postgresql/main "$@"
fi
;;
*)