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