network: write config to file if and only if user select network config

Signed-off-by: Dunrong Huang <riegamaths@gmail.com>