Fix handling of command-line options

This commit is contained in:
billz 2019-09-30 18:58:12 +01:00
parent 3404aeebe0
commit 83e6f60cb7
2 changed files with 19 additions and 19 deletions

View file

@ -8,25 +8,6 @@ raspap_dir="/etc/raspap"
raspap_user="www-data"
webroot_dir="/var/www/html"
version=`sed 's/\..*//' /etc/debian_version`
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
# Determine Raspbian version, set default home location for lighttpd and
# php package to install

View file

@ -2,6 +2,25 @@ UPDATE_URL="https://raw.githubusercontent.com/billz/raspap-webgui/master/"
wget -q ${UPDATE_URL}/installers/common.sh -O /tmp/raspapcommon.sh
source /tmp/raspapcommon.sh && rm -f /tmp/raspapcommon.sh
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
function update_system_packages() {
install_log "Updating sources"
sudo apt-get update || install_error "Unable to update package list"