开发者

Run bash script to control JBoss from Windows using PLink.exe?

开发者 https://www.devze.com 2023-01-06 06:56 出处:网络
I created a windows batch file with the following content: plink -batch PuttySaveSessionName -pw thePassword \"bash stop.sh\"

I created a windows batch file with the following content:

plink -batch PuttySaveSessionName -pw thePassword "bash stop.sh"

stop.sh is located in the home directory of the linux machine I log in to, and has the following content:

echo "starting..."
cd //path_to_jboss_dir/jboss/bin
./spcrun.stop
echo "finished"

If I execute the Windows batch file I receive the following output and the serv开发者_如何学Goer is still running:

starting...
finished
JAVA_HOME system property is undefined.
Please define JAVA_HOME and start JBoss again.

If I use putty to log in, and follow the commands above, the server shuts down.

I need the same behavior using pLink from Windows. Any ideas on what the problem is?


Executing "bash cmd" starts a non-interactive shell session; not all of your shell setup files will be parsed.

You can either execute bash -l cmd or move the required settings from your profile (probably $HOME/.profile) to your rc file ($HOME/.bashrc).

0

精彩评论

暂无评论...
验证码 换一张
取 消