ifcfg/write-ifcfg.sh: fixed logic

seems like nobody tested this with recent dracut versions.