scripts/wait-until
joachimschmidt557 a384efb6c6
fix
2025-02-05 00:43:21 +01:00

12 lines
256 B
Bash
Executable file

#!/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 ))
sleep $sleep_seconds