Elastix Project

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0000060 [Elastix distro] Other minor always 2009-04-04 09:24 2013-08-13 14:35
Reporter danardf View Status public  
Assigned To a_villacis
Priority normal Resolution open  
Status closed   Product Version
Summary 0000060: http://<YOUR-IP-HERE> [^]
Description I did make a fresh isntall With Elastix 1.5.2-2 and I did set the IP address with this cmd : system-config-network.
It's ok, but after login I have always http://<YOUR-IP-HERE> [^] and not http://193.107.20.28 [^]

It's an old default!

Let me explain.
The ifconfig result is:
eth0 Link encap:Ethernet HWaddr 08:00:27:B3:FA:D7
          inet adr:193.107.20.28 Bcast:193.107.20.255 Masque:255.255.255.0

And you can see that there's :
inet adr and not
inet addr.

I did make an install in french. And address in french writting: adresse (only one d)

So, into /usr/local/sbin/motd.sh

there's into the line:

IPADDR=`$IFCONFIG eth0|gawk '/inet addr/{print $2}'|gawk -F: '{print $2}'`

So must be changed by:

IPADDR=`$IFCONFIG eth0|gawk '/inet adr/{print $2}'|gawk -F: '{print $2}'`

After change:
Welcome to Elastix
----------------------------------------------------

For access to the Elastix web GUI use this URL
http://193.107.20.28 [^]

All is right.








Additional Information Install FR
Tags No tags attached.
Attached Files

- Relationships

-  Notes
(0000169)
danardf (reporter)
2009-04-04 10:11

I did make some modifications into this script.

I did make a test (if 'addr' matching or not)

#!/bin/sh
IFCONFIG=`which ifconfig 2>/dev/null||echo /sbin/ifconfig`
# IPADDR=`$IFCONFIG eth0|gawk '/inet adr/{print $2}'|gawk -F: '{print $2}'`
test_lang=`ifconfig | grep adr:`
echo "result = $test_lang" > /dev/null
if $result
then
IPADDR=`$IFCONFIG eth0|gawk '/inet adr/{print $2}'|gawk -F: '{print $2}'`
else
IPADDR=`$IFCONFIG eth0|gawk '/inet addr/{print $2}'|gawk -F: '{print $2}'`
fi

MSJ_NO_IP_DHCP="If you could not get a DHCP IP address please type netconfig to set up a static IP."

echo ""
echo "Welcome to Elastix "
echo "----------------------------------------------------"
echo ""
echo "For access to the Elastix web GUI use this URL"

if [ "$IPADDR" = "" ]; then
   echo "http://<YOUR-IP-HERE>" [^]
   echo "$MSJ_NO_IP_DHCP"
else
   echo "http://$IPADDR" [^]
fi

echo ""
(0000172)
a_villacis (developer)
2009-04-07 14:41

This won't work for locales et_EE or pt_BR . Set LANG=et_EE /sbin/ifconfig eth0 to see it.

The real issue is that the string used to locate the relevant output happens to be locale-specific. What is needed here is a locale-independent way to query the IPv4 address of interface eth0. It should be easy with a C program, but I am looking for a way of doing it from a shell script, as the current implementation does - otherwise we need a i386 and an x86_64 version of the program.
(0000173)
danardf (reporter)
2009-04-07 15:40

It was just a way.
I did fix my problem like that.
Now if you have another solution more general, it's better
This problem was here into Trixbox ;)

Thanks a_villacis :)
(0000529)
a_villacis (developer)
2009-08-19 17:11

An updated elastix package is available in elastix-beta repository. This version includes the fix for motd.sh.
(0000530)
danardf (reporter)
2009-08-19 21:51

I will try it.
But, how do it?
Can i try it with 1.6.5 Beta?
(0000531)
a_villacis (developer)
2009-08-20 12:05

yum --enablerepo=elastix-beta update elastix elastix-additionals
(0000532)
danardf (reporter)
2009-08-20 12:21

Excluding Packages from Beta RPM Repository for Elastix
Finished
Excluding Packages from Base RPM Repository for Elastix
Finished
Excluding Packages from Extras RPM Repository for Elastix
Finished
Excluding Packages from Updates RPM Repository for Elastix
Finished
Setting up Update Process
Could not find update match for elastix-additionals
Could not find update match for elastix
No Packages marked for Update


Haha ....a problem?
(0000538)
mihpel (reporter)
2009-08-21 19:04
edited on: 2009-08-21 19:33

Had a similar problem with the script not detecting the interface correctly.
I used a bond interface configuration and solved the issue with the following.

#!/bin/sh
IP=`which ip 2>/dev/null||echo /sbin/ip`
IFACE=$(route -n | grep UG |gawk '/\ /{print $NF}')
IPADDR=`$IP addr show ${IFACE} | grep "inet\ " | gawk '/\ /{print $2}'| sed 's/.\{3\}$//'`
MSJ_NO_IP_DHCP="If you could not get a DHCP IP address please type setup to set up a static IP."

echo ""
echo "Welcome to Elastix "
echo "----------------------------------------------------"
echo ""
echo "For access to the Elastix web GUI use this URL"

if [ "$IPADDR" = "" ]; then
   echo "http://<YOUR-IP-HERE>" [^]
   echo "$MSJ_NO_IP_DHCP"
else
   echo "http://$IPADDR" [^]
fi

echo ""


EDIT :

Giving a bit more though this can also be done retaining ifconfig :

IFCONFIG=`which ifconfig 2>/dev/null||echo /sbin/ifconfig`
IFACE=$(route -n | grep UG |gawk '/\ /{print $NF}')
IPADDR=`$IFCONFIG $IFACE | grep "inet\ " | gawk '/\ /{print $2}' | gawk -F: '{print $2}'`

(0002554)
bmacias (administrator)
2010-11-15 14:47

Alex, mihpel post a seggestion, please comment your opinion?
(0002572)
danardf (reporter)
2010-11-16 00:00

Hi Bruno.
I never had any answer about that.
I had a RPM problem but after nothing.
 
But I think that about Elastix 2.x, there's not any problem with it.
You must simply be careful with the language difference. (addr & adr), that's all.

It's just about my origin problem.

Regards

- Issue History
Date Modified Username Field Change
2009-04-04 09:24 danardf New Issue
2009-04-04 09:24 danardf Elastix version => 1.5.2-2
2009-04-04 10:11 danardf Note Added: 0000169
2009-04-07 14:29 a_villacis Issue Monitored: a_villacis
2009-04-07 14:41 a_villacis Note Added: 0000172
2009-04-07 15:40 danardf Note Added: 0000173
2009-04-09 16:12 bmacias Assigned To => a_villacis
2009-04-09 16:12 bmacias Status new => assigned
2009-08-19 17:11 a_villacis Note Added: 0000529
2009-08-19 21:51 danardf Note Added: 0000530
2009-08-20 12:05 a_villacis Note Added: 0000531
2009-08-20 12:21 danardf Note Added: 0000532
2009-08-21 19:04 mihpel Note Added: 0000538
2009-08-21 19:15 mihpel Note Edited: 0000538
2009-08-21 19:28 mihpel Note Edited: 0000538
2009-08-21 19:28 mihpel Note Edited: 0000538
2009-08-21 19:33 mihpel Note Edited: 0000538
2010-11-15 14:47 bmacias Note Added: 0002554
2010-11-16 00:00 danardf Note Added: 0002572
2013-08-13 14:35 achuto Status assigned => closed


Mantis 1.1.6[^]
Copyright © 2000 - 2008 Mantis Group
Powered by Mantis Bugtracker