]> git.pld-linux.org Git - packages/postgresql.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Mon, 30 Oct 2006 16:42:15 +0000 (16:42 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    postgresql.init -> 1.72

postgresql.init

index d1184c98c0e3a939c4dea89e252998245f640dd3..e6c0cdc51b2da114db0639ca2d41781d9e63f3cf 100644 (file)
@@ -114,12 +114,7 @@ pgsubsys() {
 # End of useful functions.
 #
 
-
-# See how we were called.
-# Every action is performed for all given (all configured by default)
-# db clusters.
-case "$action" in
-  start)
+start() {
        for pgdir in $DB_CLUSTERS; do
                pgstatus "$pgdir"
                if [ "$PG_STATUS" = "running" ]; then
@@ -139,8 +134,9 @@ case "$action" in
                fi
        done
        pgsubsys
-       ;;
-  stop)
+}
+
+stop() {
        for pgdir in $DB_CLUSTERS; do
                pgstatus "$pgdir"
                if [ "$PG_STATUS" = "not running" ]; then
@@ -166,6 +162,17 @@ case "$action" in
                fi
        done
        pgsubsys
+}
+
+# See how we were called.
+# Every action is performed for all given (all configured by default)
+# db clusters.
+case "$action" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   status)
        for pgdir in $DB_CLUSTERS; do
@@ -181,8 +188,8 @@ case "$action" in
        done
        ;;
   restart)
-       $0 stop "$DB_CLUSTERS"
-       $0 start "$DB_CLUSTERS"
+       stop
+       start
        ;;
   reload|force-reload)
        for pgdir in $DB_CLUSTERS; do
This page took 0.15009 seconds and 4 git commands to generate.