File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -7,12 +7,21 @@ function handle_usr1(){
77 # Ensure giph only receives SIGUSR1 ONCE
88 if [[ -n $FFMPEG_PID && " $signal_usr1_handled " == false ]]; then
99 signal_usr1_handled=true
10- kill $FFMPEG_PID
10+ kill $FFMPEG_PID
1111 wait $FFMPEG_PID
1212 fi
1313}
1414
15+ function handle_usr2(){
16+ if [[ -n $FFMPEG_PID ]]; then
17+ kill -KILL $FFMPEG_PID
18+ fi
19+ delete_temporary_directory
20+ exit 1
21+ }
22+
1523trap handle_usr1 SIGUSR1
24+ trap handle_usr2 SIGUSR2
1625
1726readonly VERSION=1.1.1
1827
@@ -493,9 +502,10 @@ function stop_all_recordings() {
493502}
494503
495504
496- # Todo
497505function abort_all_recordings() {
498- :
506+ for pid in $( pgrep -f " bash.+giph" ) ; do
507+ kill -USR2 -$pid
508+ done
499509}
500510
501511if [ -n " $SHOULD_STOP " ]; then
You can’t perform that action at this time.
0 commit comments