From 77080663ee192074a50c1221d39180d66d4e4d14 Mon Sep 17 00:00:00 2001 From: Alexey Khit Date: Tue, 6 Sep 2022 14:10:08 +0300 Subject: [PATCH] Add the feature for update to any version --- build/hassio/run.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/build/hassio/run.sh b/build/hassio/run.sh index e8c96900..6132571a 100644 --- a/build/hassio/run.sh +++ b/build/hassio/run.sh @@ -2,6 +2,16 @@ set +e +# add the feature for update to any version +if [ -f "/config/go2rtc.version" ]; then + branch=`cat /config/go2rtc.version` + echo "Update to version $branch" + git clone --depth 1 --branch "$branch" https://github.com/AlexxIT/go2rtc \ + && cd go2rtc \ + && CGO_ENABLED=0 go build -ldflags "-s -w" -trimpath -o /usr/local/bin \ + && rm -r /go2rtc && rm /config/go2rtc.version +fi + # set cwd for go2rtc (for config file, Hass itegration, etc) cd /config