Created
March 29, 2019 09:28
-
-
Save MatteoOreficeIT/7abe5107668485dd6599dbac1856785c to your computer and use it in GitHub Desktop.
systemd unit to write network metadata informations
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[Unit] | |
Description=Write Network Configurations Metadata to /run/network/meta-environ | |
Requires=network-online.target | |
After=network-online.target | |
Before=containerd.service docker.service | |
[Service] | |
Type=oneshot | |
RemainAfterExit=yes | |
ExecStart=/bin/bash -c "FILE=/run/network/meta-environ ; hostname -i | sed -e '$ s/^/HOST_ADDRESS_IPV4=/' > $FILE" | |
ExecStop=/bin/rm /run/network/meta-environ | |
[Install] | |
RequiredBy=containerd.service docker.service |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment