#!/bin/bash

# if ARB_WAIT_TIMEOUT is set and contains a positive integer (>0), else 0
if [[ -n ${ARB_WAIT_TIMEOUT+x} && ${ARB_WAIT_TIMEOUT} =~ ^[1-9][0-9]*$ ]]; then
  SECWAIT=${ARB_WAIT_TIMEOUT}
else
  SECWAIT=0
fi

if [ "${SECWAIT}" = 0 ]; then
    echo "[Press ENTER to close window]"
    read A
else
    echo "[Press ENTER or wait ${SECWAIT} seconds to close window]"
    read -t ${SECWAIT} A
    true
fi

