Merge with upstream master

This commit is contained in:
billz 2021-04-15 09:01:29 +01:00
parent 263e326281
commit 6741560f1a
1 changed files with 4 additions and 6 deletions

View File

@ -38,6 +38,7 @@ set -eo pipefail
function _main() { function _main() {
# set defaults # set defaults
repo="RaspAP/raspap-webgui" # override with -r, --repo option repo="RaspAP/raspap-webgui" # override with -r, --repo option
repo_common="$repo"
_parse_params "$@" _parse_params "$@"
_setup_colors _setup_colors
_log_output _log_output
@ -72,6 +73,7 @@ function _parse_params() {
;; ;;
-r|--repo|--repository) -r|--repo|--repository)
repo="$2" repo="$2"
repo_common="$repo"
shift shift
;; ;;
-b|--branch) -b|--branch)
@ -91,10 +93,6 @@ function _parse_params() {
acctoken="$2" acctoken="$2"
shift shift
;; ;;
-t|--token)
acctoken="$2"
shift
;;
-v|--version) -v|--version)
_version _version
;; ;;
@ -188,6 +186,7 @@ function _get_release() {
readonly RASPAP_LATEST=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' ) readonly RASPAP_LATEST=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' )
if [ "$insiders" == 1 ]; then if [ "$insiders" == 1 ]; then
repo="RaspAP/raspap-insiders" repo="RaspAP/raspap-insiders"
repo_common="RaspAP/raspap-webgui"
readonly RASPAP_INSIDERS_LATEST=$(curl -s "https://api.raspap.com/repos/RaspAP/raspap-insiders/releases/latest/" | grep -Po '"tag_name": "\K.*?(?=")' ) readonly RASPAP_INSIDERS_LATEST=$(curl -s "https://api.raspap.com/repos/RaspAP/raspap-insiders/releases/latest/" | grep -Po '"tag_name": "\K.*?(?=")' )
readonly RASPAP_RELEASE="${RASPAP_INSIDERS_LATEST} Insiders" readonly RASPAP_RELEASE="${RASPAP_INSIDERS_LATEST} Insiders"
else else
@ -227,7 +226,6 @@ function _update_system_packages() {
# Fetch required installer functions # Fetch required installer functions
function _load_installer() { function _load_installer() {
# fetch latest release tag # fetch latest release tag
_get_release _get_release
@ -242,7 +240,7 @@ function _load_installer() {
header=(--header "Authorization: token $acctoken") header=(--header "Authorization: token $acctoken")
fi fi
UPDATE_URL="https://raw.githubusercontent.com/$repo/$branch/" UPDATE_URL="https://raw.githubusercontent.com/$repo_common/$branch/"
header=() header=()
if [[ ! -z "$acctoken" ]]; then if [[ ! -z "$acctoken" ]]; then
header=(--header "Authorization: token $acctoken") header=(--header "Authorization: token $acctoken")