Skip to content

Commit 4c31fc2

Browse files
authored
Merge pull request #775 from ceph/ipaddrdhcp
tools: Exclude `option host-name` from grep hostname in set-next-server
2 parents 38bbb39 + e759ffc commit 4c31fc2

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/set-next-server.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ fogip="172.21.0.72"
3737
fogfilename="/undionly.kpxe"
3838
macaddr=$(sed -n "/host ${host}-front/,/}/p" $dhcpconfig | grep 'hardware ethernet' | awk '{ print $3 }' | tr -d ';')
3939
ipaddr=$(sed -n "/host ${host}-front/,/}/p" $dhcpconfig | grep 'fixed-address' | awk '{ print $2 }' | tr -d ';')
40-
linenum=$(grep -n $host $dhcpconfig | cut -d ':' -f1)
40+
linenum=$(grep -n $host $dhcpconfig | grep -v "host-name" | cut -d ':' -f1)
4141

4242
if [ -z "$macaddr" ]; then
4343
echo "No MAC address found for $host"

0 commit comments

Comments
 (0)