Is it possible to have an ASH script catch an “abort” instruction and run a function to clean up, rather than simply stopping immediately?
Alternatively, is it possible to accept user input without halting unless it is received? Like a version of wait() where it is listening for instructions (e.g. “cancel”) until the duration is up?
I know it is possible to use user_confirm() with a timeout, but that creates a dialog box rather than accepting CLI input. I want my program to run on a headless system occasionally.
Alternatively, is it possible to accept user input without halting unless it is received? Like a version of wait() where it is listening for instructions (e.g. “cancel”) until the duration is up?
I know it is possible to use user_confirm() with a timeout, but that creates a dialog box rather than accepting CLI input. I want my program to run on a headless system occasionally.