I need to get out the list of IP address of my machine to offer a choice to the user. Plateform : Debian Squeeze

[1] xxx.xxx.xxx.xxx
[2] xxx.xxx.xxx.xxx
[3] xxx.xxx.xxx.xxx

I have no idea how to retrieve a complete list of IP addresses to a machine.

In addition, the ${machine_addr} variable return the loopback address (, so I can not use it.

I do not know if I can use a script, because this statement is required before the installation files on the server.

Thank you in advance.

This question is marked "community wiki".

asked 31 Jul '12, 09:45

mrinco's gravatar image

accept rate: 50%

Which platforms do you have to support

(31 Jul '12, 09:54) juanjo ♦♦

Sorry, It's a Debian Squeeze!

(31 Jul '12, 10:59) mrinco

You could use the below code:

      <execArgs> | grep "inet add"  | grep -v | awk '{print $2}' | awk 'BEGIN { FS=":" } { print $2 }'</execArgs>
     <setInstallerVariable name="ipsText" value=""/>
 <foreach variables="ip" values="${ips}">
        <setInstallerVariable name="ipsText" value="${ipsText}&#xA;${ip}=${ip}"/>

To populate an existing parameter:


In any case, you could still use a packed script an unpack it manually under /tmp as explained here.


answered 31 Jul '12, 11:37

juanjo's gravatar image

juanjo ♦♦
accept rate: 23%

Thank you so much for your help, it work great!

(01 Aug '12, 06:16) mrinco

Well 1 I would like to add another code snippet to find ip address :

proc ip:address {} { # find out localhost's IP address # courtesy David Gravereaux, Heribert Dahms set TheServer [socket -server none -myaddr [info hostname] 0] set MyIP [lindex [fconfigure $TheServer -sockname] 0] close $TheServer return $MyIP }

you can also implement Ip-details.com to find your public ip address .


answered 16 Dec '13, 07:19

creamuser's gravatar image

accept rate: 0%

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported



Asked: 31 Jul '12, 09:45

Seen: 3,207 times

Last updated: 16 Dec '13, 07:19