Fill out apt cache config file
Some checks are pending
continuous-integration/laminar-eldarion Build failed with exit code 128 after 1 second

This commit is contained in:
Starbeamrainbowlabs 2021-11-26 00:06:18 +00:00
parent a7483500ff
commit d896a5831b
Signed by: sbrl
GPG key ID: 1BE5172E637709C2
2 changed files with 56 additions and 6 deletions

View file

@ -7,6 +7,11 @@ fi
############################################################################### ###############################################################################
step_current="0";
step_max="1";
###############################################################################
### ###
# Load the lantern build engine # Load the lantern build engine
### ###
@ -22,4 +27,30 @@ if [ ! -f "${lantern_path}/lantern.sh" ]; then git submodule update --init "${la
#shellcheck disable=SC1090 #shellcheck disable=SC1090
source "${lantern_path}/lantern.sh"; source "${lantern_path}/lantern.sh";
#shellcheck disable=SC1090
source "/etc/os-release";
############################################################################### ###############################################################################
###############################################################################
ask_yesno() {
local question="$1";
whiptail --title "Step ${step_current} / ${step_max}" --yesno "${question}" 40 8;
return "$?"; # Not actually needed, but best to be explicit
}
###############################################################################
# ███████ ████████ ███████ ██████ ██
# ██ ██ ██ ██ ██ ███
# ███████ ██ █████ ██████ ██
# ██ ██ ██ ██ ██
# ███████ ██ ███████ ██ ██
step_current="1";
if ask_yesno "Use apt cache?"; then
source ./steps/10-apt-cache.sh;
fi

View file

@ -1,9 +1,28 @@
#!/usr/bin/env bash #!/usr/bin/env bash
enable_apt_cache() {
local apt_caching_server="http://172.16.230.100:3142";
echo 'Acquire::http { Proxy \"http://172.16.230.100:3142\"; }' | tee /etc/apt/apt.conf.d/proxy task_begin "Configuring ${apt_caching_server} as apt cache";
subtask_begin "Updating apt configuration";
echo 'Acquire::http { Proxy \"${apt_caching_server}\"; }' >/etc/apt/apt.conf.d/proxy
subtask_end "$?";
echo 'deb http://archive.raspberrypi.org/debian/ buster main ui' | tee /etc/apt/sources.list.d/raspi.list # From /etc/os-release - see run.sh
if [[ "${ID}" == "raspbian" ]]; then
subtask_begin "Patching for Raspbian [ 1 / 2 ]";
echo 'deb http://archive.raspberrypi.org/debian/ buster main ui' >/etc/apt/sources.list.d/raspi.list;
subtask_end "$?";
rm /etc/apt/sources.list.d/raspi; subtask_begin "Patching for Raspbian [ 2 / 2 ]";
if [[ -e "/etc/apt/sources.list.d/raspi" ]]; then
rm /etc/apt/sources.list.d/raspi;
fi
subtask_end "$?";
fi
task_end "$?" "Failed to configure apt cache.";
}
enable_apt_cache;