chore(scripts): when running in non-interactive mode, do not enable neither start any driver.

Eg: when building Falco docker image, and installing Falco package, we don't want it to build any driver.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro
2022-10-14 09:05:38 +02:00
committed by poiana
parent 818f717622
commit e26aa6a385
2 changed files with 40 additions and 32 deletions

View File

@@ -17,13 +17,13 @@
#
set -e
chosen_driver="kmod"
chosen_driver=
if [ -z "$PS1" ]; then
echo "Skipping driver selection in non-interactive mode"
else
case "$1" in
configure)
if [ ! -t 0 ] ; then
echo "Skipping driver selection in non-interactive mode"
else
if [ -x /usr/bin/dialog ]; then
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco driver" --menu "Choose one of the following options:" 15 40 4 \
1 "Kmod" \
@@ -42,10 +42,12 @@ else
chosen_driver=
;;
esac
else
chosen_driver="kmod"
fi
fi
;;
esac
fi
case "$chosen_driver" in
"kmod")

View File

@@ -16,9 +16,11 @@
#
set -e
chosen_driver="kmod"
chosen_driver=
if [ -z "$PS1" ]; then
case "$1" in
configure)
if [ ! -t 0 ] ; then
echo "Skipping driver selection in non-interactive mode"
else
if [ -x /usr/bin/dialog ]; then
@@ -39,8 +41,12 @@ else
chosen_driver=
;;
esac
else
chosen_driver="kmod"
fi
fi
;;
esac
case "$chosen_driver" in
"kmod")