2018-12-21 12:23:16 +00:00
|
|
|
#!/bin/bash
|
|
|
|
set -euo pipefail
|
|
|
|
|
|
|
|
source ${HOME}/bin/script_framework.sh
|
|
|
|
|
|
|
|
time=${1:-}
|
|
|
|
[ -z "${time}" ] && fail "No time specified"
|
|
|
|
|
|
|
|
tdiff=$(($(date -d "$1" +%s) - $(date +%s)))
|
2023-01-12 18:03:16 +00:00
|
|
|
[ $tdiff -gt 0 ] || tdiff=$((tdiff + 86400))
|
2018-12-21 12:23:16 +00:00
|
|
|
|
2023-01-12 18:03:16 +00:00
|
|
|
step "Sleeping ${tdiff}s until $(date -d "now + ${tdiff} seconds" "+%Y-%m-%d %H:%M:%S")..."
|
2018-12-21 12:23:16 +00:00
|
|
|
sleep ${tdiff}
|