Skip to content

Commit

Permalink
remove variables NETMASK,BROADCAST and usage of moreutils
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Mar 3, 2021
1 parent f1fc634 commit 9d0c753
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions lib/get-boot-info
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
# bootinfo -- get boot information via DHCP protocol
#
# This script is part of FAI (Fully Automatic Installation)
# (c) 2003-2019 by Thomas Lange, lange@informatik.uni-koeln.de
# (c) 2003-2021 by Thomas Lange, lange@informatik.uni-koeln.de
# Universitaet zu Koeln
#
#*********************************************************************
Expand Down Expand Up @@ -77,18 +77,16 @@ setnet() {

# only write info if interface is known
if [ -n "$NIC1" ]; then
read IPADDR NETMASK BROADCAST dummy<<<$(ifdata -p $NIC1)
CIDR=$(ip -o -f inet addr show| awk '{print $4}'| grep $IPADDR)
CIDR=$(ip --br ad sh $NIC1|awk '{print $3}')
IPADDR=${CIDR%/*}
GATEWAYS=$(ip route | awk '/^default/ {print $3}')

cat >> $bootlog <<-EOF
NIC1=$NIC1
IPADDR=$IPADDR
SERVER=$SERVER
NETMASK=$NETMASK
GATEWAYS=$GATEWAYS
BROADCAST=$BROADCAST
CIDR=$CIDR
NIC1=$NIC1
GATEWAYS=$GATEWAYS
SERVER=$SERVER
EOF
fi

Expand Down

0 comments on commit 9d0c753

Please sign in to comment.