install: Add ability to append network config

* If a network tail file is found, append to the generated config.
* This functionality allows users to create a tail file @
  /etc/systemd/network/template/dosync-${interface}.network.tail to
  add additional options to the network config.
* Example use case: Adding "Tunnel=name-of-tunnel" to the eth0
  interface file to signal systemd-networkd to bring up a tunnel using
  the eth0 interface.
This commit is contained in:
Kyle Manna 2015-07-08 01:31:52 -07:00
parent 0c6f25d25e
commit 87f7960687
1 changed files with 5 additions and 0 deletions

View File

@ -912,6 +912,11 @@ process_interface() {
fi
log "Added IPv6 address ${address}/${prefix} on ${interface}."
fi
local network_tail=/etc/systemd/network/template/dosync-${interface}.network.tail
if [[ -r "${network_tail}" ]]; then
cat ${network_tail}
log "Appended user specified config for ${interface}."
fi
} > /run/systemd/network/dosync-${interface}.network
}