You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by hezjing <he...@gmail.com> on 2011/01/31 09:03:51 UTC

How to retrieve IP address

Hi

May I know if it is possible to retrieve the IP address of the running
server in Ant?


-- 

Hez

Re: How to retrieve IP address

Posted by Gilbert Rebhan <gi...@maksimo.de>.
-------- Original Message  --------
Subject: Re: How to retrieve IP address
From: Dominique Devienne <dd...@gmail.com>
To: Ant Users List <us...@ant.apache.org>
Date: Mon Jan 31 2011 16:08:21 GMT+0100 (CET)

> On Mon, Jan 31, 2011 at 2:03 AM, hezjing <he...@gmail.com> wrote:
>> May I know if it is possible to retrieve the IP address of the running
>> server in Ant?
> 
> Google found it for me in Antelope, a 3rd party collection of Ant tasks:
> 
> http://antelope.tigris.org/nonav/docs/manual/bk03ch16.html
> 
> Might be possible with pure Ant too, not sure where though. --DD

Simply use a shell wrapped up in <exec> task, output caught via
outputproperty for further processing, f.e. =

/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'

Windows user may use ipconfig ..


Regards, Gilbert






---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to retrieve IP address

Posted by Dominique Devienne <dd...@gmail.com>.
On Mon, Jan 31, 2011 at 2:03 AM, hezjing <he...@gmail.com> wrote:
> May I know if it is possible to retrieve the IP address of the running
> server in Ant?

Google found it for me in Antelope, a 3rd party collection of Ant tasks:

http://antelope.tigris.org/nonav/docs/manual/bk03ch16.html

Might be possible with pure Ant too, not sure where though. --DD

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: How to retrieve IP address

Posted by Martijn Kruithof <jm...@famkruithof.net>.
On 31-1-2011 9:03, hezjing wrote:
> Hi
>
> May I know if it is possible to retrieve the IP address of the running
> server in Ant?
>
>
http://ant.apache.org/manual/Tasks/hostinfo.html

using the standard ant <hostinfo/> task the ADDR4 property is set, which 
will contain the address of the host ant is running on.


br Martijn

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org