From 9f6d352899ddeaaaf9f4d5362e4119bd8bd99cfc Mon Sep 17 00:00:00 2001 From: Tobias Stein Date: Sat, 10 Dec 2022 21:18:37 +0100 Subject: [PATCH] Add failing script to install firefox --- roles/fai/templates/srv/fai/config/scripts/04-snaps | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/roles/fai/templates/srv/fai/config/scripts/04-snaps b/roles/fai/templates/srv/fai/config/scripts/04-snaps index 1b0ffd9..b05ccd6 100755 --- a/roles/fai/templates/srv/fai/config/scripts/04-snaps +++ b/roles/fai/templates/srv/fai/config/scripts/04-snaps @@ -1,15 +1,18 @@ #!/bin/bash +### FAILS: snapd is not running during FAI + if [ "${#SNAPS[*]}" -eq 0 ]; then SNAPS=( firefox ) fi function package_exists() { - return dpkg -l "$1" &> /dev/null + $ROOTCMD dpkg -l "$1" &> /dev/null + return $? } -for SNAP in $SNAPS; do - if ! package_exists "snapd"; then - snap install "$SNAP" +for SNAP in "${SNAPS[@]}"; do + if package_exists "snapd"; then + $ROOTCMD snap install "$SNAP" fi done