-if grep -xFq 'VERSION="8 (jessie)"' /etc/os-release; then
- gpg -a --recv-keys 2BF8D9FE074BCDE4; gpg -a --export 2BF8D9FE074BCDE4 | apt-key add -
- cat >/etc/apt/sources.list.d/fai.list <<'EOF'
-deb https://fai-project.org/download jessie koeln
-EOF
-elif grep -iE 'VERSION=.*(stretch|flidas|xenail|buster|etiona)' /etc/os-release; then
- # fai on ubuntu only has official support using the universe repo, but newer
- # tends to have less bugs.
- wget -O - https://fai-project.org/download/2BF8D9FE074BCDE4.asc | apt-key add -
-
- case $base in
- stretch)
- cat >/etc/apt/sources.list.d/fai.list <<'EOF'
-deb https://fai-project.org/download stretch koeln
-EOF
- ;;
- buster)
- cat >/etc/apt/sources.list.d/fai.list <<'EOF'
-deb https://fai-project.org/download buster koeln
+# fai on ubuntu only has official support using the universe repo, but newer
+# tends to have less bugs.
+wget -O - https://fai-project.org/download/2BF8D9FE074BCDE4.asc | apt-key add -
+
+update=false
+case $base in
+ stretch|bullseye|bullseye)
+ if ! grep -qFx "deb https://fai-project.org/download $base koeln" /etc/apt/sources.list.d/fai.list; then
+ update=true
+ fi
+ cat >/etc/apt/sources.list.d/fai.list <<EOF
+deb https://fai-project.org/download $base koeln