Add simple sleep-until script

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2018-12-21 13:23:16 +01:00
parent b02bb44d5f
commit a8ba81fe7c
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

12
bin/sleep-until Executable file
View file

@ -0,0 +1,12 @@
#!/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}