Scripting password prompt for restarting Jboss application

Hi

When I do on console a stop, the script prompts for password

> stop_idm_suite.sh

Suite system password:

Here experct of the shell script stop_idm_suite.sh

DoIt()
{

  # prompt System password
  echo ""
  ${BMC_JAVA_HOME}/java -Didm.suite.home=${BMC_IDM_SUITE_HOME} -classpath ${BMC_IDM_SUITE_HOME}/general/tools/lib/security.jar com.bmc.idm.ctsa.securityconf.P
asswordByConfig || die "Failed in security pre-checks"

  cd ${JBOSS_HOME}/bin ||  die "Failed in: cd ${JBOSS_HOME}/bin"

  SHUTDOWN_CMD="${SHUTDOWN} --server=${JBOSS_HOST}:${JBOSS_JNDI_PORT}"


  echo ${SHUTDOWN_CMD}

  sh ${SHUTDOWN_CMD}
}

Howto automate this password prompt?

I tried

> cat restart.sh
#!/usr/bin/tcsh
source /opt/idmsuite/.bmc_cshrc
stop_idm_suite.sh < /tmp/answer.txt && start_idm_suite.sh < /tmp/answer.txt
> cat answer.txt

jxHzuj5HGlCvKDUzB5Or

If just feeding it into stdin like that doesn't work, then it may demand that the password be read from a terminal, in which case you'd need a utility like ssh or expect to feed automatic input into a 'real' terminal.

Keeping passwords in a file is very insecure. Would the utility still work if you just commented out the password check and protected it by different means? (user groups, sudo, etc)