Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix setting myip in FAI_CONFIG_SCR in /var/log/fai/variables #106

Closed
wants to merge 1 commit into from

Conversation

KarolNi
Copy link

@KarolNi KarolNi commented Feb 28, 2021

Hello
I'm trying to make fai-server in vagrant (https://github.com/KarolNi/fai_server_vagrant) and had issue with multiple network interfaces (vagrant creates one for internal stuff).
This change fixed it (when $SERVERINTERFACE is set). As far as I could find out $dev was never set.
I think this is the only place affected, but you may look here: d26ee40
Also I don't know whether I should write some changelog records

Mrfai added a commit that referenced this pull request Feb 28, 2021
@Mrfai
Copy link
Contributor

Mrfai commented Feb 28, 2021

Thanks for reporting this bug. You are right $dev is never set. I've modified your fix and use bash variable substitution instead of a pipe.

  • myip=$(ip ad show $dev|sed -ne '/127.0.0.1/!{s/^[ \t]inet[ \t]([0-9.]+)/.*$/\1/p}'|head -1)
  • myip=${iprange%/*}

@Mrfai Mrfai closed this Feb 28, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants