Minor: comments + get_release()

This commit is contained in:
billz 2021-03-10 06:27:29 +00:00
parent 860a5d21d8
commit f905434b0b
2 changed files with 13 additions and 12 deletions

View file

@ -640,9 +640,10 @@ function _optimize_php() {
function _install_complete() { function _install_complete() {
_install_log "Installation completed" _install_log "Installation completed"
echo "Join RaspAP Insiders for access to exclusive features:" echo "Join RaspAP Insiders for early access to exclusive features!"
echo -e "${ANSI_RASPBERRY}" echo -e "${ANSI_RASPBERRY}"
echo "> https://github.com/sponsors/RaspAP" echo "> https://docs.raspap.com/insiders/"
echo "> https://github.com/sponsors/RaspAP/"
echo -e "${ANSI_RESET}" echo -e "${ANSI_RESET}"
if [ "$assume_yes" == 0 ]; then if [ "$assume_yes" == 0 ]; then
# Prompt to reboot if wired ethernet (eth0) is connected. # Prompt to reboot if wired ethernet (eth0) is connected.

View file

@ -15,11 +15,11 @@
# -c, --cert, --certficate Installs mkcert and generates an SSL certificate for lighttpd # -c, --cert, --certficate Installs mkcert and generates an SSL certificate for lighttpd
# -o, --openvpn <flag> Used with -y, --yes, sets OpenVPN install option (0=no install) # -o, --openvpn <flag> Used with -y, --yes, sets OpenVPN install option (0=no install)
# -a, --adblock <flag> Used with -y, --yes, sets Adblock install option (0=no install) # -a, --adblock <flag> Used with -y, --yes, sets Adblock install option (0=no install)
# -r, --repo, --repository <name> Overrides the default GitHub repo (raspap/raspap-webgui) # -r, --repo, --repository <name> Overrides the default GitHub repo (RaspAP/raspap-webgui)
# -b, --branch <name> Overrides the default git branch (master) # -b, --branch <name> Overrides the default git branch (master)
# -t, --token <accesstoken> Specify a GitHub token to access a private repository # -t, --token <accesstoken> Specify a GitHub token to access a private repository
# -u, --upgrade Upgrades an existing installation to the latest release version # -u, --upgrade Upgrades an existing installation to the latest release version
# -i, --insiders Installs from the Insiders Edition (raspap/raspap-insiders) # -i, --insiders Installs from the Insiders Edition (RaspAP/raspap-insiders)
# -v, --version Outputs release info and exits # -v, --version Outputs release info and exits
# -h, --help Outputs usage notes and exits # -h, --help Outputs usage notes and exits
# #
@ -45,7 +45,7 @@ function _main() {
} }
function _parse_params() { function _parse_params() {
# default flag values # default option values
assume_yes=0 assume_yes=0
upgrade=0 upgrade=0
ovpn_option=1 ovpn_option=1
@ -132,11 +132,11 @@ OPTIONS:
-c, --cert, --certificate Installs an SSL certificate for lighttpd -c, --cert, --certificate Installs an SSL certificate for lighttpd
-o, --openvpn <flag> Used with -y, --yes, sets OpenVPN install option (0=no install) -o, --openvpn <flag> Used with -y, --yes, sets OpenVPN install option (0=no install)
-a, --adblock <flag> Used with -y, --yes, sets Adblock install option (0=no install) -a, --adblock <flag> Used with -y, --yes, sets Adblock install option (0=no install)
-r, --repo, --repository <name> Overrides the default GitHub repo (raspap/raspap-webgui) -r, --repo, --repository <name> Overrides the default GitHub repo (RaspAP/raspap-webgui)
-b, --branch <name> Overrides the default git branch (latest release) -b, --branch <name> Overrides the default git branch (latest release)
-t, --token <accesstoken> Specify a GitHub token to access a private repository -t, --token <accesstoken> Specify a GitHub token to access a private repository
-u, --upgrade Upgrades an existing installation to the latest release version -u, --upgrade Upgrades an existing installation to the latest release version
-i, --insiders Installs from the Insiders Edition (raspap/raspap-insiders) -i, --insiders Installs from the Insiders Edition (RaspAP/raspap-insiders)
-v, --version Outputs release info and exits -v, --version Outputs release info and exits
-h, --help Outputs usage notes and exits -h, --help Outputs usage notes and exits
@ -180,12 +180,12 @@ function _display_welcome() {
# Fetch latest release from GitHub or RaspAP Installer API # Fetch latest release from GitHub or RaspAP Installer API
function _get_release() { function _get_release() {
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
RASPAP_INSIDERS_LATEST=$(curl -s "https://install.raspap.com/repos/RaspAP/raspap-insiders/releases/latest/" | grep -Po '"tag_name": "\K.*?(?=")' ) readonly RASPAP_INSIDERS_LATEST=$(curl -s "https://install.raspap.com/repos/RaspAP/raspap-insiders/releases/latest/" | grep -Po '"tag_name": "\K.*?(?=")' )
RASPAP_RELEASE="${RASPAP_INSIDERS_LATEST} Insiders" readonly RASPAP_RELEASE="${RASPAP_INSIDERS_LATEST} Insiders"
else else
RASPAP_RELEASE="${RASPAP_LATEST}" readonly RASPAP_LATEST=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' )
readonly RASPAP_RELEASE="${RASPAP_LATEST}"
fi fi
} }