meta-google: gbmc-bridge: Terminate DHCP after reachable

We don't want to continue running DHCP after a machine is ready to serve
traffic. We will only run the DHCP process for a short amount of time if
we can determine that the BMC can reach network services because it was
already correctly configured.

Change-Id: Ie79e0582718af88a4a170b2a77beebfbadd5d0af
Signed-off-by: William A. Kennington III <wak@google.com>
diff --git a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
index 1a6c71a..19fa7b1 100644
--- a/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
+++ b/meta-google/recipes-google/networking/gbmc-bridge/gbmc-br-dhcp.sh
@@ -37,6 +37,10 @@
 # shellcheck disable=SC1091
 source /usr/share/network/lib.sh || exit
 
+# Write out the current PID and cleanup when complete
+trap 'rm -f /run/gbmc-br-dhcp.pid' EXIT
+echo "$$" >/run/gbmc-br-dhcp.pid
+
 if [ "$1" = bound ]; then
   # Variable is from the environment via udhcpc6
   # shellcheck disable=SC2154