Add simple sleep-until script
Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
parent
b02bb44d5f
commit
a8ba81fe7c
1 changed files with 12 additions and 0 deletions
12
bin/sleep-until
Executable file
12
bin/sleep-until
Executable 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}
|
Loading…
Reference in a new issue