chore: make dontstart default dialog selection.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro 2022-10-25 10:22:51 +02:00 committed by poiana
parent 4596c919a6
commit ca55e70a33
2 changed files with 41 additions and 49 deletions

View File

@ -21,33 +21,29 @@ chosen_driver=
case "$1" in
configure)
if [ ! -t 0 ] ; then
echo "Skipping driver selection in non-interactive mode"
if [ -x /usr/bin/dialog ]; then
# If dialog is installed, create a dialog to let users choose the correct driver for them
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco driver" --menu "Choose one of the following options:" 15 40 4 \
1 "Don't start" \
2 "Kmod" \
3 "eBPF" \
4 "Plugin" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
chosen_driver="kmod"
;;
2)
chosen_driver="ebpf"
;;
3)
chosen_driver="plugin"
;;
esac
else
if [ -x /usr/bin/dialog ]; then
# If dialog is installed, create a dialog to let users choose the correct driver for them
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco driver" --menu "Choose one of the following options:" 15 40 4 \
1 "Kmod" \
2 "eBPF" \
3 "Plugin" \
4 "Don't start" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
chosen_driver="kmod"
;;
2)
chosen_driver="ebpf"
;;
3)
chosen_driver="plugin"
;;
esac
else
# Default at old behavior: enable kmod driver
chosen_driver="kmod"
fi
# Default at old behavior: enable kmod driver
chosen_driver="kmod"
fi
;;
esac

View File

@ -20,33 +20,29 @@ chosen_driver=
case "$1" in
configure)
if [ ! -t 0 ] ; then
echo "Skipping driver selection in non-interactive mode"
else
if [ -x /usr/bin/dialog ]; then
if [ -x /usr/bin/dialog ]; then
# If dialog is installed, create a dialog to let users choose the correct driver for them
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco driver" --menu "Choose one of the following options:" 15 40 4 \
1 "Kmod" \
2 "eBPF" \
3 "Plugin" \
4 "Don't start" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
chosen_driver="kmod"
;;
2)
chosen_driver="ebpf"
;;
3)
chosen_driver="plugin"
;;
esac
else
1 "Don't start" \
2 "Kmod" \
3 "eBPF" \
4 "Plugin" \
2>&1 >/dev/tty)
clear
case $CHOICE in
1)
chosen_driver="kmod"
;;
2)
chosen_driver="ebpf"
;;
3)
chosen_driver="plugin"
;;
esac
else
# Default at old behavior: enable kmod driver
chosen_driver="kmod"
fi
fi
;;
esac