bbb-pre-install.sh: support ubuntu 22.04

This commit is contained in:
2025-11-23 18:13:00 +01:00
parent e69d35c393
commit cea53f2325

View File

@@ -130,6 +130,8 @@ detect_os () {
DIST="${DIST// /}" DIST="${DIST// /}"
DIST_VERSION="${DIST_VERSION// /}" DIST_VERSION="${DIST_VERSION// /}"
DIST_VERSION_MAJOR=$(echo $DIST_VERSION | cut -d'.' -f1)
} }
@@ -555,10 +557,11 @@ echo -e " \033[32mInstall latest version of docker\033[m"
echo -e " \033[1m---\033[m" echo -e " \033[1m---\033[m"
:> "$log_file" :> "$log_file"
#if ! $(grep -Eq "^\s*deb\s+.*https://download.docker.com/linux/ubuntu\s+$DIST_CODENAME\s+stable" /etc/apt/sources.list) \
# && ! $(grep -r -Eq "^\s*deb\s+.*https://download.docker.com/linux/ubuntu\s+$DIST_CODENAME\s+stable" /etc/apt/sources.list.d/*) if [[ ${DIST_VERSION_MAJOR} -lt 22 ]] ; then
if ! $(grep -r -Eq "^\s*deb\s+.*https://download.docker.com/linux/ubuntu\s+$DIST_CODENAME\s+stable" /etc/apt/*)
then if ! $(grep -r -Eq "^\s*deb\s+.*https://download.docker.com/linux/ubuntu\s+$DIST_CODENAME\s+stable" /etc/apt/*)
then
blank_line blank_line
@@ -623,10 +626,69 @@ then
echo_ok echo_ok
fi fi
else else
info "Docker repository already present." info "Docker repository already present."
fi
else
echononl "Add GPG key for official Docker repository.."
if [[ -f "/etc/apt/keyrings/docker.asc" ]] ; then
echo_skipped
else
curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc > "$log_file" 2>&1
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interrupted by user."
else
echo_ok
fi
fi
echononl "Add (official) Docker-Repository to APT sources.."
tee /etc/apt/sources.list.d/docker.sources <<EOF > "$log_file" 2>&1
Types: deb
URIs: https://download.docker.com/linux/ubuntu
Suites: $(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}")
Components: stable
Signed-By: /etc/apt/keyrings/docker.asc
EOF
if [[ $? -ne 0 ]]; then
echo_failed
error "$(cat "$log_file")"
echononl "continue anyway [yes/no]: "
read OK
OK="$(echo "$OK" | tr '[:upper:]' '[:lower:]')"
while [[ "$OK" != "yes" ]] && [[ "$OK" != "no" ]] ; do
echononl "Wrong entry! - repeat [yes/no]: "
read OK
done
[[ $OK = "yes" ]] || fatal "Interrupted by user."
else
echo_ok
fi
fi fi
echononl "Install docker-ce .." echononl "Install docker-ce .."
if $(dpkg -s docker-ce> /dev/null 2>&1 ) ; then if $(dpkg -s docker-ce> /dev/null 2>&1 ) ; then