+function configure_apt_proxy() {
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG beginning of function
+ OSM_APT_PROXY=$1
+ OSM_APT_PROXY_FILE="/etc/apt/apt.conf.d/osm-apt"
+ echo "Configuring apt proxy in file ${OSM_APT_PROXY_FILE}"
+ if [ ! -f ${OSM_APT_PROXY_FILE} ]; then
+ sudo bash -c "cat <<EOF > ${OSM_APT_PROXY}
+Acquire::http { Proxy \"${OSM_APT_PROXY}\"; }
+EOF"
+ else
+ sudo sed -i "s|Proxy.*|Proxy \"${OSM_APT_PROXY}\"; }|" ${OSM_APT_PROXY_FILE}
+ fi
+ sudo apt-get -y update || FATAL "Configured apt proxy, but couldn't run 'apt-get update'. Check ${OSM_APT_PROXY_FILE}"
+ [ -z "${DEBUG_INSTALL}" ] || DEBUG end of function
+}
+
+while getopts ":a:b:r:n:k:u:R:D:o:O:m:N:H:S:s:t:U:P:A:l:L:K:d:p:T:f:F:-: hy" o; do