12 lines
256 B
Plaintext
12 lines
256 B
Plaintext
|
#!/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
|