From 83e6f60cb7b92ccc6a7d0d0f90b58eaa8262f797 Mon Sep 17 00:00:00 2001 From: billz Date: Mon, 30 Sep 2019 18:58:12 +0100 Subject: [PATCH] Fix handling of command-line options --- installers/common.sh | 19 ------------------- installers/raspbian.sh | 19 +++++++++++++++++++ 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/installers/common.sh b/installers/common.sh index 635d3983..46f7c67d 100755 --- a/installers/common.sh +++ b/installers/common.sh @@ -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 diff --git a/installers/raspbian.sh b/installers/raspbian.sh index 9eb7a32b..38fabb17 100755 --- a/installers/raspbian.sh +++ b/installers/raspbian.sh @@ -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"