]> SAFE projects GIT repository - jmp/mailleur/commitdiff
Detecting the postgresql server beeing up and running while mkdb
authorJean-Marc Pigeon (Delson) <jmp@safe.ca>
Wed, 18 Jun 2025 20:32:13 +0000 (16:32 -0400)
committerJean-Marc Pigeon (Delson) <jmp@safe.ca>
Wed, 18 Jun 2025 20:32:13 +0000 (16:32 -0400)
support/crdb.sh

index cf406be3f802e0b1efcdb9f18a2a4a08ee811d45..66388ac42536dd173407afa333a3dc52fc9df7a9 100755 (executable)
@@ -28,6 +28,11 @@ case "$DB_TYPE" in
     ;;
   "POSTGRESQL" )
     SQL="psql -q"
+    /etc/rc.d/init.d/postgresql status
+    if [ $? != 0 ] ; then
+      echo "Postgresql serveur NOT found up and running (exiting!)"
+      exit 1
+      fi
     if [ ! -z "$DB_PORT" ] ; then
       SQLPORT="-p $DB_PORT"
       fi