Skip to content

Commit

Permalink
It is OK when any of the interfaces matches the current IP address fr…
Browse files Browse the repository at this point in the history
…om DNS.
  • Loading branch information
adelton committed Apr 4, 2020
1 parent a5082cf commit 1b21deb
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions ipa-server-configure-first
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,18 @@ function update_server_ip_address () {
MY_IP=''
if [ -f /run/ipa/ipa-server-ip ] ; then
MY_IP=$( cat /run/ipa/ipa-server-ip )
fi
MY_IP=${MY_IP:-$( /sbin/ip addr show | awk '/inet .*global/ { split($2,a,"/"); print a[1]; }' | head -1 )}
if [ "$CURRENT_IP" == "$MY_IP" ] ; then
return
if [ "$CURRENT_IP" == "$MY_IP" ] ; then
return
fi
else
for i in $( /sbin/ip addr show | awk '/inet .*global/ { split($2,a,"/"); print a[1]; }' ) ; do
if [ "$CURRENT_IP" == "$i" ] ; then
return
fi
if [ -z "$MY_IP" ] ; then
MY_IP="$i"
fi
done
fi

kdestroy -A
Expand Down

0 comments on commit 1b21deb

Please sign in to comment.