submit cmd file

Hi,
I've this cmd file (see attach file) that run on O.S. Linux RedHat 5.4 (2.6.18-308.1.1.el5)

I'd like to modify this cmd to start and stop some components of Oracle Access Manager
The command to start/stop are in rem command (example rem set COMMAND=. ~/.profile ; ls -l)


To start/stop the access server I must (user=omx IP=150.3.4.33):
Submit STOP_AS.CMD
then wait 2 minutes
and Submit START_AS.CMD

set COMMAND=. ~/.profile ; stop_access_server


To start/stop the identity server I must (user=odx IP=150.3.4.44):
Submit STOP_IS.CMD
then wait 2 minutes
and Submit START_IS.CMD

How can I modify this file and How can I write the command to wait 2 minutes between stop and start?
Start-exchange.cmd
ralph_reaAsked:
Who is Participating?
 
Ernie BeekConnect With a Mentor ExpertCommented:
Ok, I think I got it.

In the KIX script an SSH tunnel connection is set up to a remote device (150.3.4.6) and linked to port 2222 at your localhost (127.0.0.1). After that, the commands defined in set COMMAND are run through an SSH connection at 127.0.0.1 port 2222.

My guess would be that if you see the Continuare? prompt, that tunnel is still open and you should be able to connect using putty to 127.0.0.1 port 2222 (instead of IP 150.3.4.6 and port 22).
0
 
Ernie BeekExpertCommented:
You could use the 'sleep' command.
0
 
Ernie BeekExpertCommented:
Or, if it's unknow, download the resource tool kit: http://www.microsoft.com/en-us/download/details.aspx?id=17657
It's in there.
0
Cloud Class® Course: Microsoft Azure 2017

Azure has a changed a lot since it was originally introduce by adding new services and features. Do you know everything you need to about Azure? This course will teach you about the Azure App Service, monitoring and application insights, DevOps, and Team Services.

 
ralph_reaAuthor Commented:
Thanks!

if I start cmd file it run correctly open the Console - Quest Plink that display:
Starting tunnel...Using username "tunnel".
Waiting for tunnel...
Tunnel established !
Cleaning registry key
and then Authentication Required - Quest PuTTY for response the password.

Now I'd Like to connect to Linux shell via PuTTY. I run PuTTY.exe and in Hostname I put 150.3.4.6 Port: 22 SSH connection type but I can't get the login prompt.

What I wrong?
0
 
Ernie BeekExpertCommented:
So you're setting up a (VPN) tunnel to a remote system using that console and within the console it's then asking for the password? It looks to me that you are allready connecting to the shell within that console or am I mistaking?
It's not quite clear to me what you're trying to do exactely.
0
 
ralph_reaAuthor Commented:
In attach (start.doc) the steps I get when I start file Start-exchange.cmd.

Thanks
Start.doc
0
 
Ernie BeekExpertCommented:
I see that in start-exchange.cmd you start a console that runs KIX32:

start Apps\Console\Console.exe -d . -r "cmd /c Apps\Kix\KIX32.exe Custom\SSH.kix $PONTE=%PONTE% $SSHIP=%IP% $SSHUSER=%USER% $SSHCOMMAND=\"%COMMAND%\""

What's in the SSH.kix?
0
 
ralph_reaAuthor Commented:
if from dos I run:

start Apps\Console\Console.exe -d . -r "cmd /c Apps\Kix\KIX32.exe Custom\SSH.kix"

I get display in ssh_kix.doc file attached
ssh-kix.doc
0
 
ralph_reaAuthor Commented:
ops.....in attach file ssh.kix
SSH.txt
0
 
Ernie BeekExpertCommented:
That's not quite what I meant ;)

I would like to know what is in the SSH.kix file. It's a text file so you can open it with notepad or similar.
0
 
Ernie BeekExpertCommented:
Ah, thx.
0
 
Paul TomasiCommented:
The following command will pause a batch file for 2 minutes:

    ping 127.0.0.1 -n 120 -w 1000 >nul
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.