Simplify script
This commit is contained in:
parent
0085bd050f
commit
4552deecb3
|
@ -1,35 +1,4 @@
|
|||
#!/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
|
||||
[ -f $target/etc/apt/apt.conf.d/02proxy ] && \
|
||||
rm $target/etc/apt/apt.conf.d/02proxy
|
||||
|
|
Loading…
Reference in New Issue