Add the feature for update to any version

This commit is contained in:
Alexey Khit
2022-09-06 14:10:08 +03:00
parent d25d27a0ee
commit 77080663ee
+10
View File
@@ -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