1
0
Fork 0
mirror of https://github.com/Jonny007-MKD/OTR-DecodeAll synced 2024-05-02 20:54:06 +02: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 #
####################
# trap ctrl-c and call ctrl_c()
trap ctrl_c INT
# trap signals and handle them
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
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