36 lines
731 B
Bash
Executable File
36 lines
731 B
Bash
Executable File
#!/bin/bash
|
|
|
|
|
|
setrel() {
|
|
|
|
# if release is not set, try to determine it
|
|
|
|
if [ -n "$release" ]; then
|
|
return
|
|
elif [ ! -f "$target/etc/os-release" ]; then
|
|
return
|
|
fi
|
|
|
|
dists="jessie stretch buster bullseye bookworm trixie forky jammy focal bionic xenial trusty"
|
|
for d in $dists; do
|
|
if grep -iq "$d" "$target/etc/os-release"; then
|
|
release="$d"
|
|
break
|
|
fi
|
|
done
|
|
}
|
|
|
|
contains() {
|
|
[[ $1 =~ (^|[[:space:]])$2($|[[:space:]]) ]] && exit 0 || exit 1
|
|
}
|
|
|
|
DISTS_TO_UPGRADE="jessie stretch buster trixie forky focal bionic xenial trusty"
|
|
|
|
if contains "$DISTS_TO_UPGRADE" "$release"; then
|
|
KEEP_PROXY_FOR_UPGRADE=true
|
|
fi
|
|
|
|
if [ ! "$KEEP_PROXY_FOR_UPGRADE" ]; then
|
|
rm -f $target/etc/apt/apt.conf.d/02proxy
|
|
fi
|