I looked for such a script on the 'net and did not find so here's a solution, tessted with the edge case of an address line at the end of the file:
Code:
#!/bin/bash
eth_regex=^eth
true=true
false=
address=
have_iface_flag=$false
while read -r word1 word2 word3 word4 _
do
case $word1 in
iface )
[[ $word2 =~ $eth_regex && $word4 != dhcp ]] \
...