Skip to content

Commit 78ac4a4

Browse files
committed
Add username/password check and append auth details to a couch db connectivity check
1 parent 949aafd commit 78ac4a4

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

install/assets/functions/10-db-backup

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -943,14 +943,16 @@ backup_sqlite3() {
943943

944944
check_availability() {
945945
if var_true "${DEBUG_CHECK_AVAILABILITY}" ; then debug on; fi
946-
### Set the Database Type
947946
if var_false "${backup_job_skip_availability_check}" ; then
948947
case "${dbtype}" in
949948
"couch" )
950949
counter=0
951950
code_received=0
951+
if [ -n "${backup_job_db_user}" ] && [ -n ${backup_job_db_pass} ]; then
952+
_ca_couch_auth="-u ${backup_job_db_user}:${backup_job_db_pass}"
953+
fi
952954
while [ "${code_received}" != "200" ]; do
953-
code_received=$(run_as_user curl -XGET -sSL -o /dev/null -L -w ''%{http_code}'' ${backup_job_db_host}:${backup_job_db_port})
955+
code_received=$(run_as_user curl -XGET -sSL -o /dev/null -L -w ''%{http_code}'' ${_ca_couch_auth} ${backup_job_db_host}:${backup_job_db_port})
954956
if [ "${code_received}" = "200" ] ; then break ; fi
955957
sleep 5
956958
(( counter+=5 ))

0 commit comments

Comments
 (0)