Scripting password prompt for restarting Jboss application


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Scripting password prompt for restarting Jboss application
# 1  
Old 06-21-2011
Scripting password prompt for restarting Jboss application

Hi

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

Code:
> stop_idm_suite.sh

Suite system password:

Here experct of the shell script stop_idm_suite.sh

Code:
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

Code:
> 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

Code:
> cat answer.txt

jxHzuj5HGlCvKDUzB5Or

# 2  
Old 06-21-2011
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)
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Windows & DOS: Issues & Discussions

How can I start a cygwin application from windows 7 command prompt?

I have compiled an application called tmesh.exe, that was compiled for the cygwin, win7 platform. I wonder, if I do that outside X window, Is there a chance that I can run it on the command prompt of windows 7? (tmesh:4048): Gtk-WARNING **: cannot open display: THANKS Jack (3 Replies)
Discussion started by: lucky7456969
3 Replies

2. Web Development

Starting Web Application on Jboss

Hello, I installed Jboss EAP 6 on a remote Linux server in standalone mode, and deployed a HelloWorld war file successfully. Opened a browser on my PC and pointed to http://127.0.0.1:8080/filename. I can see “Hello World!” on my browser. However, if the browser points to http://server's... (3 Replies)
Discussion started by: learnix
3 Replies

3. UNIX for Dummies Questions & Answers

Sudo -s without password prompt

hi, i have a requirement where i need to sudo to another user in the shell script.suppose consider user A and B, first user A calls a shell script and then i need to sudo to user B which executes another shell script inside the earlier one. also this needs to be automated like while sudo'ing to... (3 Replies)
Discussion started by: krk
3 Replies

4. UNIX for Advanced & Expert Users

Append password on script when restarting web instance

im writing a start/stop script for a web instance (solaris) . Currently I usually start it using the command below and it will ask me to put the token password for the web_instance. (token pw: 12345) /opt/SUNWwbsvr/https-www.myhost.com/start I would like to create a script that... (4 Replies)
Discussion started by: lhareigh890
4 Replies

5. Solaris

How to prompt for the new password during the first login

Hi All, I have created a new user. Using the below command I have created the user successfully. useradd -c "Test user" -d /tmp/test -g Testgroup -s /bin/ksh -u 601 Test I don't want to set the password using “passwd” command after creating a user. I want to prompt for the new... (2 Replies)
Discussion started by: kalpeer
2 Replies

6. Shell Programming and Scripting

Help with restarting of application with reboot of AIX server

Hi, We have hosted our application on AIX server. The problem is that we have to start our application manually once the server is rebooted. Please guide me in writing a script that does this job automatically with the re-start of the server. I'm looking for something like windows services in... (2 Replies)
Discussion started by: himanshu397
2 Replies

7. UNIX for Advanced & Expert Users

Changing the password prompt

Is there any way I can change the prompt which asks for the password on a UNIX system? e.g. When I login using Telnet instead of "Password" I should get "Correct Password". Thanks, Vineet (3 Replies)
Discussion started by: vineetd
3 Replies

8. Red Hat

JBoss Application Server 5 CR1 available

The first candidate release (CR1) for JBoss Application Server 5 has been released. There is a lot of good background from Sacha Labourey and feature details from project lead Dimitris Andreadis. Now that version 5 of the new application server has been through alpha and beta stages, this... (0 Replies)
Discussion started by: Linux Bot
0 Replies

9. Shell Programming and Scripting

any way to use SU command without prompt for password

Hi, First i want to tell you i am not a administrator and everytime to run a sqlscritpt i have to login as SU in a particular account to connect to sqlplus.. I want to write a script which can make me free by doin this .. since i am having the permission for SU i want to know if i can SUDO... (7 Replies)
Discussion started by: myelvis
7 Replies

10. UNIX for Dummies Questions & Answers

rcp without password prompt

Hi, i have a request about rcp. is it possible to to make a rcp sessions for a normal user witch should have this option without a password prompt. what are the important steps .... add the host and user i the .rhosts and and . . . . many thx (1 Reply)
Discussion started by: scottl
1 Replies
Login or Register to Ask a Question