This is very strange! Have you checked that the output you're looking at has been modified
after the execution of the modified command (with interface instead of end)? Sorry for the silly question, but I'm trying to figure out what really happen!
By the way, here is an alternative (and more pedantic) awk command (just to have a proof of the correct awk processing)
Code:
exec cat /conf/$USER/$port/.tmpconfig | awk "BEGIN {toprint=0} /!/{toprint=1} /end/{print \$0 ; toprint=0} {if (toprint!=0) {print \$0}}" > /conf/$USER/$port/$namn.txt