mirror of
https://github.com/falcosecurity/falco.git
synced 2025-09-08 01:59:33 +00:00
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:
committed by
poiana
parent
76c8a645f1
commit
4c550bbe06
@@ -15,38 +15,41 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
set -e
|
|
||||||
|
|
||||||
chosen_driver=
|
chosen_driver=
|
||||||
|
|
||||||
if [ "$1" = "configure" ]; then
|
if [ "$1" = "configure" ]; then
|
||||||
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
|
# 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" \
|
1 "Don't start" \
|
||||||
2 "Kmod" \
|
2 "Kmod" \
|
||||||
3 "eBPF" \
|
3 "eBPF" \
|
||||||
4 "Modern eBPF" \
|
4 "Modern eBPF" \
|
||||||
5 "Plugin" \
|
5 "Plugin" \
|
||||||
2>&1 >/dev/tty)
|
2>&1 >/dev/tty)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
case $CHOICE in
|
||||||
|
2)
|
||||||
|
chosen_driver="kmod"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
chosen_driver="bpf"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
chosen_driver="modern-bpf"
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
chosen_driver="plugin"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
clear
|
clear
|
||||||
case $CHOICE in
|
|
||||||
2)
|
|
||||||
chosen_driver="kmod"
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
chosen_driver="bpf"
|
|
||||||
;;
|
|
||||||
4)
|
|
||||||
chosen_driver="modern-bpf"
|
|
||||||
;;
|
|
||||||
5)
|
|
||||||
chosen_driver="plugin"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# If needed, try to load/compile the driver through falco-driver-loader
|
# If needed, try to load/compile the driver through falco-driver-loader
|
||||||
case "$chosen_driver" in
|
case "$chosen_driver" in
|
||||||
"kmod")
|
"kmod")
|
||||||
|
@@ -14,38 +14,42 @@
|
|||||||
# See the License for the specific language governing permissions and
|
# See the License for the specific language governing permissions and
|
||||||
# limitations under the License.
|
# limitations under the License.
|
||||||
#
|
#
|
||||||
set -e
|
|
||||||
|
|
||||||
chosen_driver=
|
chosen_driver=
|
||||||
|
|
||||||
if [ $1 -eq 1 ]; then
|
if [ $1 -eq 1 ]; then
|
||||||
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
|
# 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" \
|
1 "Don't start" \
|
||||||
2 "Kmod" \
|
2 "Kmod" \
|
||||||
3 "eBPF" \
|
3 "eBPF" \
|
||||||
4 "Modern eBPF" \
|
4 "Modern eBPF" \
|
||||||
5 "Plugin" \
|
5 "Plugin" \
|
||||||
2>&1 >/dev/tty)
|
2>&1 >/dev/tty)
|
||||||
|
# When user presses cancel, go on as default (don't start)
|
||||||
|
if [ $? -eq 0 ]; then
|
||||||
|
case $CHOICE in
|
||||||
|
2)
|
||||||
|
chosen_driver="kmod"
|
||||||
|
;;
|
||||||
|
3)
|
||||||
|
chosen_driver="bpf"
|
||||||
|
;;
|
||||||
|
4)
|
||||||
|
chosen_driver="modern-bpf"
|
||||||
|
;;
|
||||||
|
5)
|
||||||
|
chosen_driver="plugin"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
fi
|
||||||
clear
|
clear
|
||||||
case $CHOICE in
|
|
||||||
2)
|
|
||||||
chosen_driver="kmod"
|
|
||||||
;;
|
|
||||||
3)
|
|
||||||
chosen_driver="bpf"
|
|
||||||
;;
|
|
||||||
4)
|
|
||||||
chosen_driver="modern-bpf"
|
|
||||||
;;
|
|
||||||
5)
|
|
||||||
chosen_driver="plugin"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
set -e
|
||||||
|
|
||||||
# If needed, try to load/compile the driver through falco-driver-loader
|
# If needed, try to load/compile the driver through falco-driver-loader
|
||||||
case "$chosen_driver" in
|
case "$chosen_driver" in
|
||||||
"kmod")
|
"kmod")
|
||||||
|
Reference in New Issue
Block a user