1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-DecodeAll synced 2025-01-22 08:49:50 +01:00

Better signal handling

This commit is contained in:
Jonny007-MKD 2015-04-06 20:54:59 +02:00
parent ce9e673076
commit a358a63391

View file

@ -29,12 +29,25 @@ PwD=$(dirname "$PwD")
# Helper functions # # Helper functions #
#################### ####################
# trap ctrl-c and call ctrl_c() # trap signals and handle them
trap ctrl_c INT trap t_sigint SIGINT # Ctrl+C
trap t_sighup SIGHUP # Hangup on Terminal
trap t_sigcont SIGCONT # Continue after stop
function ctrl_c() { function t_sigint {
funcUnlock funcUnlock
exit exit 2
}
function t_sighup {
# Do nothing
sleep 0
}
function t_sigcont {
if [ -n "$lastProcessingEcho" ]; then
echo -e "$lastProcessingEcho"
fi
} }
# Log message to stdout and log file # Log message to stdout and log file