Link to home
Start Free TrialLog in
Avatar of zenguru
zenguru

asked on

convert linux script to run on windows xp

I have the following working script on my local linux box in my home dir named deploy:

#/bin/bash
cd /home/revo/test3 && \
grails clean && \
grails prod war test39.war && \
echo "scp to remote"
scp ~/test3/test39.war root@44.249.185.169:/root/uploads && \
echo "tomcat stop"
ssh root@44.249.185.169 "/etc/init.d/tomcat stop" && \
ssh root@44.249.185.169 "rm -rf /usr/local/tomcat/webapps/ROOT/*" && \
ssh root@44.249.185.169 "cd /usr/local/tomcat/webapps/ROOT ; /usr/java/jdk/bin/jar -xvf /root/uploads/test39.war"  && \
ssh root@44.249.185.169 "/etc/init.d/tomcat start" && \
echo "all done"

I simply type ./deploy in terminal to deploy the whole thing to remote server from my local linux box.

Now I need to port above to my local Win XP box. Assume the script would be located at C:\ and instead of /home/revo/test3, I have C:/test3 folder on Win XP and have the same executable program grails on Win XP. Also on Linux I have ssh-add to connect with the remote server with passsword preauthenticated before the  script is run. But on Win XP there is no such setup. Assume the remote server credentials:  user name: root  password: pswd  So when you port above script to Win XP , it should also take care of this. On Win XP I have Putty installed.
So please rewrite above script to run in Win XP given the details above.
ASKER CERTIFIED SOLUTION
Avatar of dcesari
dcesari
Flag of Italy image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of zenguru
zenguru

ASKER

I am looking for a solution without cygwin probably converting above script to some sort of windows .bat file. Yes on linux I had setup public and private keys using ssh-keygen.