Update 2024-02-14 07:51 OpenBSD/amd64-x13
This commit is contained in:
11
.bin/timer
Executable file
11
.bin/timer
Executable file
@@ -0,0 +1,11 @@
|
||||
#!/bin/sh
|
||||
|
||||
case $1 in
|
||||
stop) rm -f /tmp/timer.txt \
|
||||
&& echo stopped
|
||||
;;
|
||||
*) [ -f /tmp/timer.txt ] \
|
||||
&& echo $(( $(date +%s) - $(</tmp/timer.txt) )) \
|
||||
|| ( date +%s > /tmp/timer.txt && echo started )
|
||||
;;
|
||||
esac
|
||||
Reference in New Issue
Block a user