fix rep drain script to correctly output to stdout
BOSH relies on drain scripts printing an integer to stdout
set -e
+# Redirect stdout to fd 3 so that output_for_bosh can echo correctly
+exec 3>&1
+
source /var/vcap/packages/pid_utils/pid_utils.sh
run_dir=/var/vcap/sys/run/rep
@@ -12,8 +15,6 @@ address=<%= p("diego.rep.enable_legacy_api_endpoints") ? p("diego.rep.listen_add
mkdir -p $log_dir
-exec 3>&1
-
exec 1>> $logfile
exec 2>> $logfile
