Author: glen                         Date: Mon Oct 30 16:40:50 2006 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- sanity
- head -n syntax

---- Files affected:
SOURCES:
   postgresql.init (1.70 -> 1.71) 

---- Diffs:

================================================================
Index: SOURCES/postgresql.init
diff -u SOURCES/postgresql.init:1.70 SOURCES/postgresql.init:1.71
--- SOURCES/postgresql.init:1.70        Mon Oct 30 16:41:22 2006
+++ SOURCES/postgresql.init     Mon Oct 30 17:40:44 2006
@@ -71,15 +71,15 @@
 pgstatus() {
        PG_STATUS="unknown"
        PG_PID="unknown"
-       output=`LC_ALL=C TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -D $1 
status"`
-       status=`echo $?`
+       output=$(LC_ALL=C TMPDIR=/tmp su postgres -c "/usr/bin/pg_ctl -D $1 
status")
+       status=$?
 
        if [ $status -eq 1 ]; then
                PG_STATUS="not running"
        elif [ $status -eq 0 ]; then
                PG_STATUS="running"
         # or maybe grab it from postmaster.pid file?
-               PG_PID=`echo "$output" | sed 's/^pg_ctl:.*PID: 
\([0-9]\+\).*/\1/' | head -1`
+               PG_PID=`echo "$output" | sed 's/^pg_ctl:.*PID: 
\([0-9]\+\).*/\1/' | head -n 1`
        fi
 }
 
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/postgresql.init?r1=1.70&r2=1.71&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to