From 94a9001f7dd9736841739105040d41a2537d2f86 Mon Sep 17 00:00:00 2001 From: Eric Nemchik Date: Wed, 14 Mar 2018 08:49:59 -0500 Subject: [PATCH] Add force parameter to allow specific version to be installed. (#24) --- update_ombi.sh | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/update_ombi.sh b/update_ombi.sh index 934a923..cafd71e 100644 --- a/update_ombi.sh +++ b/update_ombi.sh @@ -60,6 +60,7 @@ archshort=${arch:0:3} while [ $# -gt 0 ]; do case "$1" in --verbosity|-v=*) + shift if [[ ${1#*=} =~ ^-?[0-8]$ ]]; then verbosity="${1#*=}" else @@ -69,6 +70,17 @@ while [ $# -gt 0 ]; do exit 1 fi ;; + --force|-f=*) + shift + if [[ ${1#*=} =~ ^[0-9]+\.[0-9]+\.[0-9]+$ ]]; then + force="${1#*=}" + else + printf "****************************\n" + printf "* Error: Invalid version. *\n" + printf "****************************\n" + exit 1 + fi + ;; *) printf "****************************\n" printf "* Error: Invalid argument. *\n" @@ -188,6 +200,10 @@ do .log 8 "json: $json" latestversion=$(grep -Po '(?<="updateVersionString":")([^"]+)' <<< "$json") .log 7 "latestversion: $latestversion" + if [ -n "$force" ]; then + latestversion=$force + .log 7 "forcing version: $latestversion" + fi json=$(curl -sL https://ci.appveyor.com/api/projects/tidusjar/requestplex/build/$latestversion) .log 8 "json: $json" jobId=$(grep -Po '(?<="jobId":")([^"]+)' <<< "$json")