I have written this menu that calls forth several scripts. One of this script is
dbus-monitor --system
so it displays live traffic over dbus.
but when I want to exit this I normally do Ctrl+C, but that also exits my menu and I would like to just return to my menu.
is there a code that I can put after the dbus-moniter, when an exit is detected it starts my menu again? my menu is just another .sh script
or ....
---------------- clarify ---------------
i am not that advanced "yet" ;) in scripting. this is the menu where i call my dbus script
select opt in "dbus Live Traffic" "option 2" "Main menu" "Quit"
do
case $opt in
"dbus Live Traffic")
curl -s -u lalala:hihihi ftp://ftp.somewhere.com/folder/dbuslivetraffic.sh | bash ;;
"option 2")
do_something ;;
"Main menu")
main_menu;;
"Quit")
quit_menu;;
esac
if [[ $opt != "Main menu" ]] || [[ $opt != "Quit" ]] ;
then
main_menu
fi
done
and this is the content of my dbuslivetraffic.sh
dbus-monitor --system
for now just this single line, but maybe in the near future more code will be added to this script.
i don't really understand where i need to put the TRAP
function like suggested by @RoVo