cfg/bin/sleep-until
Knut Ahlers a8ba81fe7c
Add simple sleep-until script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
2018-12-21 13:23:16 +01:00

12 lines
233 B
Bash
Executable file

#!/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)))
step "Sleeping ${tdiff}s until ${time}..."
sleep ${tdiff}