From 231f36896843c71b0461a962dadc530bce417444 Mon Sep 17 00:00:00 2001 From: nyyu Date: Mon, 26 Jul 2021 20:42:58 +0200 Subject: [PATCH] k3s: add auto update --- .util.sh | 2 +- k3s-bin/update.sh | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100755 k3s-bin/update.sh diff --git a/.util.sh b/.util.sh index 58910a9..575e743 100644 --- a/.util.sh +++ b/.util.sh @@ -3,7 +3,7 @@ update_github_tag() { local repo=$1 - ver=`curl -s https://api.github.com/repos/${repo}/tags | jq -r '.[0].name' | cut -c2-` + ver=`curl -Ls https://api.github.com/repos/${repo}/tags | jq -r '.[0].name' | cut -c2-` echo $ver sed -i "s/pkgver=.*/pkgver=${ver}/" PKGBUILD } diff --git a/k3s-bin/update.sh b/k3s-bin/update.sh new file mode 100755 index 0000000..f0854ad --- /dev/null +++ b/k3s-bin/update.sh @@ -0,0 +1,7 @@ +#!/bin/sh + +source ../.util.sh + +update_github_tag rancher/k3s + +update_pkg