chore(scripts): manage dialog cancel button, and increase dialog vertical size to comprehend all of 5 options.

Signed-off-by: Federico Di Pierro <nierro92@gmail.com>
This commit is contained in:
Federico Di Pierro
2022-11-17 09:53:00 +01:00
committed by poiana
parent 76c8a645f1
commit 4c550bbe06
2 changed files with 39 additions and 32 deletions

View File

@@ -15,21 +15,20 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e
chosen_driver=
if [ "$1" = "configure" ]; 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 \
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco driver" --menu "Choose one of the following options:" 15 40 5 \
1 "Don't start" \
2 "Kmod" \
3 "eBPF" \
4 "Modern eBPF" \
5 "Plugin" \
2>&1 >/dev/tty)
clear
if [ $? -eq 0 ]; then
case $CHOICE in
2)
chosen_driver="kmod"
@@ -45,7 +44,11 @@ if [ "$1" = "configure" ]; then
;;
esac
fi
clear
fi
fi
set -e
# If needed, try to load/compile the driver through falco-driver-loader
case "$chosen_driver" in

View File

@@ -14,21 +14,21 @@
# See the License for the specific language governing permissions and
# limitations under the License.
#
set -e
chosen_driver=
if [ $1 -eq 1 ]; 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 \
CHOICE=$(dialog --clear --backtitle "Choose your preferred driver" --title "Falco driver" --menu "Choose one of the following options:" 15 40 5 \
1 "Don't start" \
2 "Kmod" \
3 "eBPF" \
4 "Modern eBPF" \
5 "Plugin" \
2>&1 >/dev/tty)
clear
# When user presses cancel, go on as default (don't start)
if [ $? -eq 0 ]; then
case $CHOICE in
2)
chosen_driver="kmod"
@@ -44,7 +44,11 @@ if [ $1 -eq 1 ]; then
;;
esac
fi
clear
fi
fi
set -e
# If needed, try to load/compile the driver through falco-driver-loader
case "$chosen_driver" in