mirror of
				https://github.com/billz/raspap-webgui.git
				synced 2025-03-01 10:31:47 +00:00 
			
		
		
		
	Set default install branch to latest release
This commit is contained in:
		@@ -297,7 +297,7 @@ function _download_latest_files() {
 | 
				
			|||||||
    fi
 | 
					    fi
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    _install_log "Cloning latest files from github"
 | 
					    _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 --quiet $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"
 | 
					    sudo mv /tmp/raspap-webgui $webroot_dir || _install_status 1 "Unable to move raspap-webgui to web root"
 | 
				
			||||||
    if [ "$upgrade" == 1 ]; then
 | 
					    if [ "$upgrade" == 1 ]; then
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -37,7 +37,6 @@
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Set defaults
 | 
					# Set defaults
 | 
				
			||||||
repo="billz/raspap-webgui"
 | 
					repo="billz/raspap-webgui"
 | 
				
			||||||
branch="master"
 | 
					 | 
				
			||||||
assume_yes=0
 | 
					assume_yes=0
 | 
				
			||||||
upgrade=0
 | 
					upgrade=0
 | 
				
			||||||
ovpn_option=1
 | 
					ovpn_option=1
 | 
				
			||||||
@@ -58,6 +57,7 @@ exec 2>&1
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
# Fetch latest release from GitHub API
 | 
					# Fetch latest release from GitHub API
 | 
				
			||||||
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.*?(?=")' )
 | 
				
			||||||
 | 
					branch="$RASPAP_LATEST" #override with the -b, --branch option
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Define usage notes
 | 
					# Define usage notes
 | 
				
			||||||
usage=$(cat << EOF
 | 
					usage=$(cat << EOF
 | 
				
			||||||
@@ -67,7 +67,7 @@ Usage: raspbian.sh [OPTION]\n
 | 
				
			|||||||
-o, --openvpn <flag>\n\tUsed with -y, --yes, sets OpenVPN install option (0=no install)
 | 
					-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)
 | 
					-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)
 | 
					-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
 | 
					-h, --help\n\tOutputs usage notes and exits
 | 
				
			||||||
-u, --upgrade\n\tUpgrades an existing installation to the latest release version
 | 
					-u, --upgrade\n\tUpgrades an existing installation to the latest release version
 | 
				
			||||||
-v, --version\n\tOutputs release info and exits\n
 | 
					-v, --version\n\tOutputs release info and exits\n
 | 
				
			||||||
 
 | 
				
			|||||||
@@ -205,16 +205,6 @@ function _remove_sudoers() {
 | 
				
			|||||||
    echo "Done."
 | 
					    echo "Done."
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Stops any running services related to project
 | 
					 | 
				
			||||||
function _stop_services() {
 | 
					 | 
				
			||||||
    _install_log "Stopping services"
 | 
					 | 
				
			||||||
    echo "Stopping hostapd, dnsmasq & dhcpcd"
 | 
					 | 
				
			||||||
    sudo systemctl stop hostapd.service || _install_error "Unable to stop hostapd"
 | 
					 | 
				
			||||||
    sudo systemctl stop dnsmasq.service || _install_error "Unable to stop dnsmasq"
 | 
					 | 
				
			||||||
    sudo systemctl stop dhcpcd.service || _install_error "Unable to stop dhcpcd"
 | 
					 | 
				
			||||||
    echo "Done."
 | 
					 | 
				
			||||||
}
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
function _uninstall_complete() {
 | 
					function _uninstall_complete() {
 | 
				
			||||||
    _install_log "Uninstall completed"
 | 
					    _install_log "Uninstall completed"
 | 
				
			||||||
    echo "It is recommended that you reboot your system as a final step."
 | 
					    echo "It is recommended that you reboot your system as a final step."
 | 
				
			||||||
@@ -228,7 +218,6 @@ function _remove_raspap() {
 | 
				
			|||||||
    _remove_raspap_directories
 | 
					    _remove_raspap_directories
 | 
				
			||||||
    _remove_installed_packages
 | 
					    _remove_installed_packages
 | 
				
			||||||
    _remove_sudoers
 | 
					    _remove_sudoers
 | 
				
			||||||
    _stop_services
 | 
					 | 
				
			||||||
    _uninstall_complete
 | 
					    _uninstall_complete
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 
 | 
				
			|||||||
		Reference in New Issue
	
	Block a user