Merge branch 'master' into feature/dhcp-eth0

This commit is contained in:
Bill Zimmerman
2020-12-12 17:41:41 +01:00
committed by GitHub
18 changed files with 165 additions and 96 deletions

View File

@@ -294,7 +294,7 @@ function _download_latest_files() {
fi
_install_log "Cloning latest files from github"
git clone --branch $branch --depth 1 $git_source_url /tmp/raspap-webgui || _install_status 1 "Unable to download files from github"
git clone --branch $branch --depth 1 -c advice.detachedHead=false $git_source_url /tmp/raspap-webgui || _install_status 1 "Unable to download files from github"
sudo mv /tmp/raspap-webgui $webroot_dir || _install_status 1 "Unable to move raspap-webgui to web root"
if [ "$upgrade" == 1 ]; then

View File

@@ -37,7 +37,6 @@
# Set defaults
repo="billz/raspap-webgui"
branch="master"
assume_yes=0
upgrade=0
ovpn_option=1
@@ -51,8 +50,14 @@ readonly ANSI_RASPBERRY="\033[0;35m"
readonly ANSI_ERROR="\033[1;37;41m"
readonly ANSI_RESET="\033[m"
# Log output
readonly LOGFILE_PATH="/tmp"
exec > >(tee -i $LOGFILE_PATH/raspap_install.log)
exec 2>&1
# Fetch latest release from GitHub API
readonly RASPAP_LATEST=$(curl -s "https://api.github.com/repos/$repo/releases/latest" | grep -Po '"tag_name": "\K.*?(?=")' )
branch="$RASPAP_LATEST" #override with the -b, --branch option
# Define usage notes
usage=$(cat << EOF
@@ -62,7 +67,7 @@ Usage: raspbian.sh [OPTION]\n
-o, --openvpn <flag>\n\tUsed with -y, --yes, sets OpenVPN install option (0=no install)
-a, --adblock <flag>\n\tUsed with -y, --yes, sets Adblock install option (0=no install)
-r, --repo, --repository <name>\n\tOverrides the default GitHub repo (billz/raspap-webgui)
-b, --branch <name>\n\tOverrides the default git branch (master)
-b, --branch <name>\n\tOverrides the default git branch (latest release)
-h, --help\n\tOutputs usage notes and exits
-u, --upgrade\n\tUpgrades an existing installation to the latest release version
-v, --version\n\tOutputs release info and exits\n