Update command to get latest WordOps version with curl
This commit is contained in:
@@ -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}')
|
||||
|
||||
Reference in New Issue
Block a user