mirror of
https://github.com/Unimatrix0/update_ombi.git
synced 2025-08-20 05:14:05 -07:00
Add force parameter to allow specific version to be installed.
This commit is contained in:
parent
2be16cb034
commit
f1363d0c5f
1 changed files with 17 additions and 1 deletions
|
@ -58,6 +58,7 @@ SECONDS=0
|
||||||
while [ $# -gt 0 ]; do
|
while [ $# -gt 0 ]; do
|
||||||
case "$1" in
|
case "$1" in
|
||||||
--verbosity|-v=*)
|
--verbosity|-v=*)
|
||||||
|
shift
|
||||||
if [[ ${1#*=} =~ ^-?[0-8]$ ]]; then
|
if [[ ${1#*=} =~ ^-?[0-8]$ ]]; then
|
||||||
verbosity="${1#*=}"
|
verbosity="${1#*=}"
|
||||||
else
|
else
|
||||||
|
@ -67,6 +68,17 @@ while [ $# -gt 0 ]; do
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
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 "****************************\n"
|
||||||
printf "* Error: Invalid argument. *\n"
|
printf "* Error: Invalid argument. *\n"
|
||||||
|
@ -181,6 +193,10 @@ do
|
||||||
.log 8 "json: $json"
|
.log 8 "json: $json"
|
||||||
latestversion=$(grep -Po '(?<="updateVersionString":")([^"]+)' <<< "$json")
|
latestversion=$(grep -Po '(?<="updateVersionString":")([^"]+)' <<< "$json")
|
||||||
.log 7 "latestversion: $latestversion"
|
.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)
|
json=$(curl -sL https://ci.appveyor.com/api/projects/tidusjar/requestplex/build/$latestversion)
|
||||||
.log 8 "json: $json"
|
.log 8 "json: $json"
|
||||||
jobId=$(grep -Po '(?<="jobId":")([^"]+)' <<< "$json")
|
jobId=$(grep -Po '(?<="jobId":")([^"]+)' <<< "$json")
|
||||||
|
@ -334,4 +350,4 @@ elif [ $seconds -eq 1 ]; then
|
||||||
fi
|
fi
|
||||||
durationmsg="Update complete...elapsed time $duration..."
|
durationmsg="Update complete...elapsed time $duration..."
|
||||||
durationmsg="${durationmsg// / }"
|
durationmsg="${durationmsg// / }"
|
||||||
.log 6 "$durationmsg"
|
.log 6 "$durationmsg"
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue