Restore network configuration on startup

Recent change to velia introduced persisting network configuration. It
just copies the .network file to /cfg partition. On boot it must be
restored into /run/systemd/network directory so systemd-networkd can
find the configuration.

If no configuration is found in /cfg, use the default configuration for
eth1 device, i.e., bridge.

Depends-on: https://cesnet-gerrit-czechlight/c/CzechLight/velia/+/3814
Depends-on: https://cesnet-gerrit-public/c/CzechLight/velia/+/3814
Depends-on: https://gerrit.cesnet.cz/c/CzechLight/velia/+/3814
Change-Id: I8d852b329b3189bc8c6bef5e34c0d4d86ea963b1
diff --git a/package/czechlight-cfg-fs/cfg-restore-systemd-networkd.service b/package/czechlight-cfg-fs/cfg-restore-systemd-networkd.service
new file mode 100644
index 0000000..c8ca250
--- /dev/null
+++ b/package/czechlight-cfg-fs/cfg-restore-systemd-networkd.service
@@ -0,0 +1,14 @@
+[Unit]
+Description=Restore systemd-networkd network settings from /cfg
+After=cfg.mount
+Requires=cfg.mount
+Before=network-pre.target
+
+[Service]
+Type=oneshot
+RemainAfterExit=yes
+ExecStartPre=/usr/bin/mkdir -p /run/systemd/network
+ExecStart=/bin/sh -c "[[ -f /cfg/network/eth1.network ]] && cp /cfg/network/eth1.network /run/systemd/network/ || true"
+
+[Install]
+WantedBy=network-pre.target