88#
99#
1010# IDENTIFICATION
11- # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.24 2001/09/21 21:10:56 tgl Exp $
11+ # $Header: /cvsroot/pgsql/src/bin/pg_ctl/Attic/pg_ctl.sh,v 1.25 2001/09/29 03:09:32 momjian Exp $
1212#
1313# -------------------------------------------------------------------------
1414
@@ -238,9 +238,9 @@ POSTOPTSFILE=$PGDATA/postmaster.opts
238238PIDFILE=$PGDATA /postmaster.pid
239239
240240if [" $op " = " status" ]; then
241- if [-f $PIDFILE ]; then
241+ if [-f " $PIDFILE " ]; then
242242PID=` sed -n 1p$PIDFILE `
243- if [$PID -lt 0 ]; then
243+ if [" $PID " -lt 0 ]; then
244244 PID=` expr 0 -$PID `
245245echo " $CMDNAME : postgres is running (pid:$PID )"
246246else
@@ -256,9 +256,9 @@ if [ "$op" = "status" ];then
256256fi
257257
258258if [" $op " = " stop" -o " $op " = " restart" -o " $op " = " reload" ]; then
259- if [-f $PIDFILE ]; then
259+ if [-f " $PIDFILE " ]; then
260260PID=` sed -n 1p$PIDFILE `
261- if [$PID -lt 0 ]; then
261+ if [" $PID " -lt 0 ]; then
262262 PID=` expr 0 -$PID `
263263echo " $CMDNAME : Cannot restart postmaster. postgres is running (pid:$PID )" 1>&2
264264echo " Please terminate postgres and try again." 1>&2
@@ -274,10 +274,10 @@ if [ "$op" = "stop" -o "$op" = "restart" -o "$op" = "reload" ];then
274274
275275while :
276276do
277- if [-f $PIDFILE ]; then
277+ if [-f " $PIDFILE " ]; then
278278$silence_echo $ECHO_N " ." $ECHO_C
279279 cnt=` expr$cnt + 1`
280- if [$cnt -gt $wait_seconds ]; then
280+ if [" $cnt " -gt " $wait_seconds " ]; then
281281$silence_echo echo " failed"
282282echo " $CMDNAME : postmaster does not shut down" 1>&2
283283exit 1
@@ -309,7 +309,7 @@ fi # stop, restart, reload
309309
310310if [" $op " = " start" -o " $op " = " restart" ]; then
311311 oldpid=" "
312- if [-f $PIDFILE ]; then
312+ if [-f " $PIDFILE " ]; then
313313echo " $CMDNAME : Another postmaster may be running. Trying to start postmaster anyway." 1>&2
314314oldpid=` sed -n 1p$PIDFILE `
315315fi
@@ -318,7 +318,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
318318if [-z " $POSTOPTS " ]; then
319319if [" $op " = " start" ]; then
320320# if we are in start mode, then look for postmaster.opts.default
321- if [-f $DEFPOSTOPTS ]; then
321+ if [-f " $DEFPOSTOPTS " ]; then
322322eval set X" ` cat$DEFPOSTOPTS ` " ; shift
323323fi
324324else
@@ -343,7 +343,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
343343# if had an old lockfile, check to see if we were able to start
344344if [-n " $oldpid " ]; then
345345sleep 1
346- if [-f $PIDFILE ]; then
346+ if [-f " $PIDFILE " ]; then
347347if [" ` sed -n 1p$PIDFILE ` " = " $oldpid " ]; then
348348echo " $CMDNAME : cannot start postmaster" 1>&2
349349echo " Examine the log output." 1>&2
@@ -376,7 +376,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
376376else
377377$silence_echo $ECHO_N " ." $ECHO_C
378378cnt=` expr$cnt + 1`
379- if [$cnt -gt $wait_seconds ]; then
379+ if [" $cnt " -gt " $wait_seconds " ]; then
380380$silence_echo echo " failed"
381381echo " $CMDNAME : postmaster does not start" 1>&2
382382exit 1