Skip to content

Commit

Permalink
use ip -br
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Mar 9, 2021
1 parent a11832a commit eba6c6c
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions bin/fai
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# fai -- main installation script executed after booting
#
# This script is part of FAI (Fully Automatic Installation)
# (c) 1999-2020 by Thomas Lange, lange@informatik.uni-koeln.de
# (c) 1999-2021 by Thomas Lange, lange@informatik.uni-koeln.de
# Universitaet zu Koeln
# (c) 2001-2005 by Henning Glawe, glaweh@physik.fu-berlin.de
# Freie Universitaet Berlin
Expand Down Expand Up @@ -118,9 +118,7 @@ fai_init() {
cat /proc/kmsg >/dev/tty4 &

# fix IP address lifetime
ip -4 addr show | \
awk '/^[0-9]+: [^:]+:/ { iface = substr($2, 1, length($2) - 1); }
/^ *inet [0-9.]*\/[0-9]* / && iface != "lo" { print $2, iface; }' | \
ip -4 -br a | awk '/UP / {if ($3) print $3 " " $1}' | \
while read addr iface; do
ip -4 addr change "$addr" dev "$iface" valid_lft forever preferred_lft forever
done
Expand Down

0 comments on commit eba6c6c

Please sign in to comment.