14 lines
287 B
Plaintext
14 lines
287 B
Plaintext
|
#!/usr/bin/env bash
|
||
|
|
||
|
d=$((`date +%s` + $1));
|
||
|
echo "Countdown started $(date)"
|
||
|
|
||
|
while [ "$d" -ge $(date +%s) ]; do
|
||
|
_dt=$(($d - `date +%s`))
|
||
|
days=$((_dt / 86400))
|
||
|
echo -ne "\r${days}d $(date -u --date @$((_dt)) +%H:%M:%S) ";
|
||
|
sleep 0.1
|
||
|
done
|
||
|
|
||
|
echo -ne "\rCountdown finished $(date)\n"
|