#!/bin/bash
if [ -f /etc/profile.d/proxy.sh ]; then
source /etc/profile.d/proxy.sh
fi

source /var/lib/postgresql/virt_env/healthcheck/bin/activate
pushd /var/lib/postgresql/healthcheck/
if [ $1 == 'true' ] && [ -n $6 ]; then 
  python queue_datacollection.py
else
  envdir /var/lib/postgresql/env/datacollection/ python queue_datacollection.py
fi
popd
