sed seems like the right tool:
sed -i '/radius-server/!b;n;n;d' filename How it works:
/radius-server/!b # as long as it's NOT 'radius-server' do nothing (branch to end) n # read next line (replace current line with next line) n # same as above - we now read 2 lines d # delete the current line