Permalink
Browse files

XX-9810 - problem getting IP address if host is not configured in dns

-if nslookup fails get IP from ifconfig eth0
  • Loading branch information...
1 parent ff90d81 commit 0dc83236708f5e1bc7374002f534299b34139158 ciuc committed Aug 19, 2011
Showing with 5 additions and 1 deletion.
  1. +5 −1 sipXconfig/bin/sipxconfig.sh.in
@@ -82,8 +82,12 @@ databaseCommand() {
pass=""
primary_not_exists=true
declare -i location_count
-
+ #try to get ip from dns, then fron eth0
ip_addr=`nslookup $PRIMARY_HOSTNAME | awk '{if (NR==5) print $NF}'`
+ if [ -z "$ip_addr"]; then
+ str=`ifconfig eth0 | awk '{if (NR==2) print $2}'`;
+ ip_addr=${str:5};
+ fi
for i in {1..8};do
pos=$((RANDOM%${#string}))

0 comments on commit 0dc8323

Please sign in to comment.