add wait-until
This commit is contained in:
parent
950c5709a3
commit
c5696f2246
1 changed files with 13 additions and 0 deletions
13
wait-until
Executable file
13
wait-until
Executable file
|
|
@ -0,0 +1,13 @@
|
|||
#!/usr/bin/env bash
|
||||
|
||||
# https://stackoverflow.com/questions/645992/sleep-until-a-specific-time-date
|
||||
|
||||
until_time=$1
|
||||
|
||||
current_epoch=$(date +%s)
|
||||
target_epoch=$(date -d $until_time +%s)
|
||||
|
||||
sleep_seconds=$(( $target_epoch - $current_epoch ))
|
||||
|
||||
echo $sleep_seconds
|
||||
# sleep $sleep_seconds
|
||||
Loading…
Add table
Add a link
Reference in a new issue