Skip to content

Commit 40cd81c

Browse files
committed
This is a simple patch to put double quotes around a few cases in
pg_ctl.sh which were unquoted when inside of []. Justin Clift
1 parent 07ce9fe commit 40cd81c

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/bin/pg_ctl/pg_ctl.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
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
238238
PIDFILE=$PGDATA/postmaster.pid
239239

240240
if [ "$op" = "status" ];then
241-
if [ -f $PIDFILE ];then
241+
if [ -f "$PIDFILE" ];then
242242
PID=`sed -n 1p $PIDFILE`
243-
if [ $PID -lt 0 ];then
243+
if [ "$PID" -lt 0 ];then
244244
PID=`expr 0 - $PID`
245245
echo "$CMDNAME: postgres is running (pid: $PID)"
246246
else
@@ -256,9 +256,9 @@ if [ "$op" = "status" ];then
256256
fi
257257

258258
if [ "$op" = "stop" -o "$op" = "restart" -o "$op" = "reload" ];then
259-
if [ -f $PIDFILE ];then
259+
if [ -f "$PIDFILE" ];then
260260
PID=`sed -n 1p $PIDFILE`
261-
if [ $PID -lt 0 ];then
261+
if [ "$PID" -lt 0 ];then
262262
PID=`expr 0 - $PID`
263263
echo "$CMDNAME: Cannot restart postmaster. postgres is running (pid: $PID)" 1>&2
264264
echo "Please terminate postgres and try again." 1>&2
@@ -274,10 +274,10 @@ if [ "$op" = "stop" -o "$op" = "restart" -o "$op" = "reload" ];then
274274

275275
while :
276276
do
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"
282282
echo "$CMDNAME: postmaster does not shut down" 1>&2
283283
exit 1
@@ -309,7 +309,7 @@ fi # stop, restart, reload
309309

310310
if [ "$op" = "start" -o "$op" = "restart" ];then
311311
oldpid=""
312-
if [ -f $PIDFILE ];then
312+
if [ -f "$PIDFILE" ];then
313313
echo "$CMDNAME: Another postmaster may be running. Trying to start postmaster anyway." 1>&2
314314
oldpid=`sed -n 1p $PIDFILE`
315315
fi
@@ -318,7 +318,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
318318
if [ -z "$POSTOPTS" ];then
319319
if [ "$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
322322
eval set X "`cat $DEFPOSTOPTS`"; shift
323323
fi
324324
else
@@ -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
344344
if [ -n "$oldpid" ];then
345345
sleep 1
346-
if [ -f $PIDFILE ];then
346+
if [ -f "$PIDFILE" ];then
347347
if [ "`sed -n 1p $PIDFILE`" = "$oldpid" ];then
348348
echo "$CMDNAME: cannot start postmaster" 1>&2
349349
echo "Examine the log output." 1>&2
@@ -376,7 +376,7 @@ if [ "$op" = "start" -o "$op" = "restart" ];then
376376
else
377377
$silence_echo $ECHO_N "."$ECHO_C
378378
cnt=`expr $cnt + 1`
379-
if [ $cnt -gt $wait_seconds ];then
379+
if [ "$cnt" -gt "$wait_seconds" ];then
380380
$silence_echo echo "failed"
381381
echo "$CMDNAME: postmaster does not start" 1>&2
382382
exit 1

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy