From 291dbd9a875414d0f8e263e9eb6570737b47a043 Mon Sep 17 00:00:00 2001 From: Michael Watters Date: Thu, 21 Apr 2016 16:52:32 -0400 Subject: [PATCH] Fix validation script to work with FreeBSD. The validate_postgresql_connection.sh script was coded to rely on bash which is not available by default in FreeBSD. Updated script to use /bin/sh which is a valid POSIX shell. --- files/validate_postgresql_connection.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/files/validate_postgresql_connection.sh b/files/validate_postgresql_connection.sh index f126d99..2b3d629 100644 --- a/files/validate_postgresql_connection.sh +++ b/files/validate_postgresql_connection.sh @@ -1,4 +1,4 @@ -#!/usr/bin/env bash +#!/bin/sh # usage is: validate_db_connection 2 50 psql @@ -8,7 +8,9 @@ PSQL=$3 STATE=1 -for (( c=1; c<=$TRIES; c++ )) +c=1 + +while [ $c -le $TRIES ] do echo $c if [ $c -gt 1 ] @@ -24,6 +26,7 @@ do then exit 0 fi +$c++ done echo 'Unable to connect to postgresql'