apt-cache: add config step
This commit is contained in:
parent
74d5b16c06
commit
5041e5aea4
1 changed files with 28 additions and 0 deletions
28
src/steps-config/10-apt-cache.sh
Executable file
28
src/steps-config/10-apt-cache.sh
Executable file
|
@ -0,0 +1,28 @@
|
||||||
|
#!/usr/bin/env bash
|
||||||
|
|
||||||
|
enable_apt_cache() {
|
||||||
|
local apt_caching_server="http://172.16.230.100:3142";
|
||||||
|
|
||||||
|
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 "$?";
|
||||||
|
|
||||||
|
# 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 "$?";
|
||||||
|
|
||||||
|
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;
|
Loading…
Reference in a new issue