From c7c7afa08f634784cfc8707d679cda78b522088f Mon Sep 17 00:00:00 2001 From: John D <427295+boostchicken@users.noreply.github.com> Date: Sat, 30 Jan 2021 00:40:55 -0800 Subject: [PATCH] Update 25-homebridge.sh add cni install --- homebridge/on_boot.d/25-homebridge.sh | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/homebridge/on_boot.d/25-homebridge.sh b/homebridge/on_boot.d/25-homebridge.sh index 7f6e1c4..d8dcdba 100755 --- a/homebridge/on_boot.d/25-homebridge.sh +++ b/homebridge/on_boot.d/25-homebridge.sh @@ -1,6 +1,25 @@ #!/bin/sh CONTAINER=homebridge +## network configuration and startup: +CNI_PATH=/mnt/data/podman/cni +if [ ! -f "$CNI_PATH"/tuning ]; then + mkdir -p $CNI_PATH + curl -L https://github.com/containernetworking/plugins/releases/download/v0.9.0/cni-plugins-linux-arm64-v0.9.0.tgz | tar -xz -C $CNI_PATH +fi + +mkdir -p /opt/cni +rm -f /opt/cni/bin +ln -s $CNI_PATH /opt/cni/bin + +for file in "$CNI_PATH"/*.conflist +do + if [ -f "$file" ]; then + ln -s "$file" "/etc/cni/net.d/$(basename "$file")" + fi +done + + # Starts the homebridge container on boot. # All configs stored in /mnt/data/homebridge