Update command to get latest WordOps version with curl

This commit is contained in:
VirtuBox
2019-10-28 11:52:32 +01:00
parent 1e5e07e277
commit 4a7bcfbf4b
2 changed files with 3 additions and 3 deletions

View File

@@ -7,7 +7,7 @@ safe_print() {
}
# Ensure sane defaults
[ -n "$URL" ] || URL="https://github.com/WordOps/WordOps/releases/latest"
[ -n "$URL" ] || URL="https://api.github.com/repos/WordOps/WordOps/releases/latest"
[ -n "$WAIT" ] || WAIT=5
[ -n "$CACHE" ] || CACHE="/var/cache/motd-wo"
@@ -18,7 +18,7 @@ CLOUD=$(mktemp) || exit 1
trap "rm -f $NEWS $ERR $CLOUD" HUP INT QUIT ILL TRAP BUS TERM
if [ -n "$(command -v curl)" ]; then
LATEST_RELEASE=$(curl -m 5 --retry 3 -sI "$URL" | grep tag | awk -F "/" '{print $8}' 2>&1)
LATEST_RELEASE=$(curl -m 5 --retry 3 -sL "$URL" | jq -r '.tag_name' 2>&1)
fi
if [ -n "$(command -v wo)" ]; then
CURRENT_RELEASE=$(wo -v 2>&1 | grep v | awk -F " " '{print $2}')