aboutsummaryrefslogtreecommitdiffhomepage
path: root/bin
diff options
context:
space:
mode:
Diffstat (limited to 'bin')
-rwxr-xr-xbin/unix/timer.sh5
1 files changed, 5 insertions, 0 deletions
diff --git a/bin/unix/timer.sh b/bin/unix/timer.sh
index 3abe701..152d828 100755
--- a/bin/unix/timer.sh
+++ b/bin/unix/timer.sh
@@ -1,6 +1,9 @@
1#! /bin/bash 1#! /bin/bash
2# Ref: https://superuser.com/questions/611538/611582#611582 2# Ref: https://superuser.com/questions/611538/611582#611582
3 3
4exec 3>&1
5exec 1>/dev/tty
6
4SIGNAL=${1:-SIGTERM} 7SIGNAL=${1:-SIGTERM}
5COMMAND="$2" 8COMMAND="$2"
6 9
@@ -75,6 +78,8 @@ timer() {
75 done 78 done
76} 79}
77 80
81trap 'exec 1>&3; echo $count; send-notify foo' EXIT KILL TERM STOP
82
78while [ $count -lt $SET ]; do 83while [ $count -lt $SET ]; do
79 [ $stop = true ] && sleep 0.3 && continue 84 [ $stop = true ] && sleep 0.3 && continue
80 timer 85 timer