2019-10-06 22:59:21 +00:00
|
|
|
#!/bin/bash
|
|
|
|
#
|
|
|
|
# RaspAP Quick Installer
|
|
|
|
# author: @billz
|
|
|
|
# license: GNU General Public License v3.0
|
|
|
|
#
|
|
|
|
# Command-line options: -y, --yes, --assume-yes
|
|
|
|
# Assume "yes" as answer to all prompts and run non-interactively
|
|
|
|
|
2016-06-16 10:03:29 +00:00
|
|
|
UPDATE_URL="https://raw.githubusercontent.com/billz/raspap-webgui/master/"
|
2019-11-04 17:18:33 +00:00
|
|
|
VERSION=$(curl -s https://api.github.com/repos/billz/raspap-webgui/releases/latest | jq -r .tag_name)
|
2016-06-16 10:03:29 +00:00
|
|
|
wget -q ${UPDATE_URL}/installers/common.sh -O /tmp/raspapcommon.sh
|
|
|
|
source /tmp/raspapcommon.sh && rm -f /tmp/raspapcommon.sh
|
|
|
|
|
2019-09-30 17:58:12 +00:00
|
|
|
assume_yes=0
|
|
|
|
positional=()
|
|
|
|
while [[ $# -gt 0 ]]
|
|
|
|
do
|
|
|
|
key="$1"
|
|
|
|
|
|
|
|
case $key in
|
|
|
|
-y|--yes|--assume-yes)
|
|
|
|
assume_yes=1
|
|
|
|
apt_option="-y"
|
|
|
|
shift # past argument
|
|
|
|
shift # past value
|
|
|
|
;;
|
|
|
|
*) # unknown option
|
|
|
|
shift # past argument
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
done
|
|
|
|
|
2016-06-16 10:03:29 +00:00
|
|
|
function update_system_packages() {
|
|
|
|
install_log "Updating sources"
|
2019-07-10 06:46:58 +00:00
|
|
|
sudo apt-get update || install_error "Unable to update package list"
|
2016-06-16 10:03:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
function install_dependencies() {
|
|
|
|
install_log "Installing required packages"
|
2019-09-30 17:44:03 +00:00
|
|
|
sudo apt-get install $apt_option lighttpd $php_package git hostapd dnsmasq vnstat || install_error "Unable to install dependencies"
|
2016-06-16 10:03:29 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
install_raspap
|